Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
virgilchiriac committed Nov 14, 2023
1 parent 22a1ba8 commit 8e1569c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
3 changes: 1 addition & 2 deletions src/services/sync/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ module.exports = function setup() {
}
}
}
// @TODO - i don't why but if i create a get methode it work without error
// @virgilchiriac we need to check this

app.use('/sync/userAccount', new UserAccountService(), { methods: [] });

app.use('/sync/api', staticContent(path.join(__dirname, '/docs/openapi.yaml')));
Expand Down
1 change: 1 addition & 0 deletions src/services/sync/services/UserAccountService.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class UserAccountService {
this.lock = new Semaphore(5);
}

// Feathers 5: at least one standard service method must be implemented to be considered a service
get() {
return undefined;
}
Expand Down
29 changes: 14 additions & 15 deletions test/services/ldap/strategies/general.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,18 @@ const mockLDAPConfig = {
},
};

const createLDAPUserResult = (props) => ({
dn: 'uid=max.mustermann.1,ou=users,o=school0,dc=de,dc=example,dc=org',
givenName: 'Max',
sn: 'Mustermann',
uid: 'max.mustermann.1',
uuid: 'ZDg0Y2ZlMjMtZGYwNi00MWNjLTg3YmUtZjI3NjA1NDJhY2Y0',
mail: '[email protected]',
memberOf: 'cn=ROLE_STUDENT,ou=roles,o=school0,dc=de,dc=example,dc=org',
...props,
});
const createLDAPUserResult = (props) => {
return {
dn: 'uid=max.mustermann.1,ou=users,o=school0,dc=de,dc=example,dc=org',
givenName: 'Max',
sn: 'Mustermann',
uid: 'max.mustermann.1',
uuid: 'ZDg0Y2ZlMjMtZGYwNi00MWNjLTg3YmUtZjI3NjA1NDJhY2Y0',
mail: '[email protected]',
memberOf: 'cn=ROLE_STUDENT,ou=roles,o=school0,dc=de,dc=example,dc=org',
...props,
};
};

describe('GeneralLDAPStrategy', () => {
it('implements AbstractLDAPStrategy', () => {
Expand All @@ -67,10 +69,6 @@ describe('GeneralLDAPStrategy', () => {
app.use('/ldap', originalLdapService);
});

afterEach(() => {
app.unuse('/ldap');
});

describe('#getSchools', () => {
it('should return school compliant with internal interface', async () => {
const schools = await new GeneralLDAPStrategy(app, mockLDAPConfig).getSchools();
Expand Down Expand Up @@ -144,6 +142,7 @@ describe('GeneralLDAPStrategy', () => {

beforeEach(() => {
ldapServiceMock = new MockLdapService();
app.unuse('/ldap');
app.use('/ldap', ldapServiceMock);
});

Expand Down Expand Up @@ -270,8 +269,8 @@ describe('GeneralLDAPStrategy', () => {
}

beforeEach(() => {
//app.unuse('/ldap');
ldapServiceMock = new MockLdapService();
app.unuse('/ldap');
app.use('/ldap', ldapServiceMock);
});

Expand Down

0 comments on commit 8e1569c

Please sign in to comment.