Skip to content

Commit

Permalink
fix(saml): change "identityProvider" path for "identityprovider"
Browse files Browse the repository at this point in the history
  • Loading branch information
gdostie committed Jan 6, 2020
1 parent 364ed0c commit 770fceb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions src/resources/Saml/Saml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ export default class Saml extends Resource {
}

deleteProvider() {
return this.api.delete(`${Saml.baseUrl}/identityProvider`);
return this.api.delete(`${Saml.baseUrl}/identityprovider`);
}

getProvider() {
return this.api.get<SamlIdentityProviderModel>(`${Saml.baseUrl}/identityProvider`);
return this.api.get<SamlIdentityProviderModel>(`${Saml.baseUrl}/identityprovider`);
}

create(identityProvider: New<SamlIdentityProviderModel>) {
return this.api.post<SamlIdentityProviderModel>(`${Saml.baseUrl}/identityProvider`, identityProvider);
return this.api.post<SamlIdentityProviderModel>(`${Saml.baseUrl}/identityprovider`, identityProvider);
}

update(identityProvider: SamlIdentityProviderModel) {
return this.api.put<SamlIdentityProviderModel>(`${Saml.baseUrl}/identityProvider`, identityProvider);
return this.api.put<SamlIdentityProviderModel>(`${Saml.baseUrl}/identityprovider`, identityProvider);
}

listRealms() {
return this.api.get<RealmModel[]>(`${Saml.baseUrl}/identityProvider/realms`);
return this.api.get<RealmModel[]>(`${Saml.baseUrl}/identityprovider/realms`);
}
}
20 changes: 10 additions & 10 deletions src/resources/Saml/tests/Saml.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,31 @@ describe('Saml', () => {
});

describe('getProvider', () => {
it('should make a GET call to "/saml/identityProvider"', () => {
it('should make a GET call to "/saml/identityprovider"', () => {
saml.getProvider();
expect(api.get).toHaveBeenCalledTimes(1);
expect(api.get).toHaveBeenCalledWith('/rest/organizations/{organizationName}/saml/identityProvider');
expect(api.get).toHaveBeenCalledWith('/rest/organizations/{organizationName}/saml/identityprovider');
});
});

describe('listRealms', () => {
it('should make a GET call to "/saml/identityProvider/realms"', () => {
it('should make a GET call to "/saml/identityprovider/realms"', () => {
saml.listRealms();
expect(api.get).toHaveBeenCalledTimes(1);
expect(api.get).toHaveBeenCalledWith('/rest/organizations/{organizationName}/saml/identityProvider/realms');
expect(api.get).toHaveBeenCalledWith('/rest/organizations/{organizationName}/saml/identityprovider/realms');
});
});

describe('deleteProvdier', () => {
it('should make a DELETE call to "/saml/identityProvider"', () => {
it('should make a DELETE call to "/saml/identityprovider"', () => {
saml.deleteProvider();
expect(api.delete).toHaveBeenCalledTimes(1);
expect(api.delete).toHaveBeenCalledWith('/rest/organizations/{organizationName}/saml/identityProvider');
expect(api.delete).toHaveBeenCalledWith('/rest/organizations/{organizationName}/saml/identityprovider');
});
});

describe('create', () => {
it('should make a POST call to "/saml/identityProvider"', () => {
it('should make a POST call to "/saml/identityprovider"', () => {
const provider: New<SamlIdentityProviderModel> = {
displayName: 'My SAML SSO',
entityId: 'whatever',
Expand All @@ -69,14 +69,14 @@ describe('Saml', () => {
saml.create(provider);
expect(api.post).toHaveBeenCalledTimes(1);
expect(api.post).toHaveBeenCalledWith(
'/rest/organizations/{organizationName}/saml/identityProvider',
'/rest/organizations/{organizationName}/saml/identityprovider',
provider
);
});
});

describe('update', () => {
it('should make a PUT call to "/saml/identityProvider"', () => {
it('should make a PUT call to "/saml/identityprovider"', () => {
const provider: SamlIdentityProviderModel = {
id: '123-abc',
displayName: 'My SAML SSO',
Expand All @@ -89,7 +89,7 @@ describe('Saml', () => {
saml.update(provider);
expect(api.put).toHaveBeenCalledTimes(1);
expect(api.put).toHaveBeenCalledWith(
'/rest/organizations/{organizationName}/saml/identityProvider',
'/rest/organizations/{organizationName}/saml/identityprovider',
provider
);
});
Expand Down

0 comments on commit 770fceb

Please sign in to comment.