From 1e1763d3eba28ed9fa710bdf4006f1915c0ae67e Mon Sep 17 00:00:00 2001 From: chasegawa Date: Mon, 28 Nov 2022 14:51:16 -0700 Subject: [PATCH] SHIBUI-2393/2474 Added checking for required fields --- .../DynamicRegistrationControllerTests.groovy | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/DynamicRegistrationControllerTests.groovy b/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/DynamicRegistrationControllerTests.groovy index d2a0d258d..a1d043a72 100644 --- a/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/DynamicRegistrationControllerTests.groovy +++ b/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/DynamicRegistrationControllerTests.groovy @@ -226,7 +226,7 @@ class DynamicRegistrationControllerTests extends AbstractBaseDataJpaTest { when: def dynReg2 = new DynamicRegistrationInfo(resourceId: 'uuid-2', enabled: false, applicationType: 'apptype', - approved: true, contacts: 'contacts', jwks: 'jwks', logoUri: 'logouri', policyUri: 'policyuri', + approved: true, contacts: 'contacts', jwks: 'jwks', logoUri: 'logouri', policyUri: 'policyuri', name: 'foo', redirectUris: 'redirecturis', responseTypes: 'responsetypes', scope: 'scope', subjectType: 'subjecttype', tokenEndpointAuthMethod: 'token', tosUri: 'tosuri', grantType: GrantType.implicit) dynamicRegistrationService.createNew(new DynamicRegistrationRepresentation(dynReg2)) @@ -281,7 +281,7 @@ class DynamicRegistrationControllerTests extends AbstractBaseDataJpaTest { @WithMockUser(value = "someUser", roles = ["USER"]) def 'POST create new '() { given: - def dynReg = new DynamicRegistrationInfo(resourceId: 'uuid-2', enabled: false, applicationType: 'apptype', + def dynReg = new DynamicRegistrationInfo(resourceId: 'uuid-2', enabled: false, applicationType: 'apptype', name: 'foo', approved: true, contacts: 'contacts', jwks: 'jwks', logoUri: 'logouri', policyUri: 'policyuri', redirectUris: 'redirecturis', responseTypes: 'responsetypes', scope: 'scope', subjectType: 'subjecttype', tokenEndpointAuthMethod: 'token', tosUri: 'tosuri', grantType: GrantType.implicit) @@ -315,7 +315,7 @@ class DynamicRegistrationControllerTests extends AbstractBaseDataJpaTest { def "PUT /DynamicRegistration updates properly as admin"() { given: def dynReg = new DynamicRegistrationInfo(resourceId: 'uuid-1', enabled: false, idOfOwner: "admingroup", applicationType: 'apptype', - approved: true, contacts: 'contacts', jwks: 'jwks', logoUri: 'logouri', policyUri: 'policyuri', + approved: true, contacts: 'contacts', jwks: 'jwks', logoUri: 'logouri', policyUri: 'policyuri', name: 'foo', redirectUris: 'redirecturis', responseTypes: 'responsetypes', scope: 'scope', subjectType: 'subjecttype', tokenEndpointAuthMethod: 'token', tosUri: 'tosuri', grantType: GrantType.implicit) repo.saveAndFlush(dynReg) @@ -374,7 +374,7 @@ class DynamicRegistrationControllerTests extends AbstractBaseDataJpaTest { def "PUT /DynamicRegistration disallows non-admin user from enabling"() { given: def dynReg = new DynamicRegistrationInfo(resourceId: 'uuid-1', enabled: false, idOfOwner: "testingGroupBBB", applicationType: 'apptype', - approved: true, contacts: 'contacts', jwks: 'jwks', logoUri: 'logouri', policyUri: 'policyuri', + approved: true, contacts: 'contacts', jwks: 'jwks', logoUri: 'logouri', policyUri: 'policyuri', name: 'foo', redirectUris: 'redirecturis', responseTypes: 'responsetypes', scope: 'scope', subjectType: 'subjecttype', tokenEndpointAuthMethod: 'token', tosUri: 'tosuri', grantType: GrantType.implicit) repo.saveAndFlush(dynReg) @@ -420,7 +420,7 @@ class DynamicRegistrationControllerTests extends AbstractBaseDataJpaTest { def "PUT /DynamicRegistration denies the request if the PUTing user is not an ADMIN and not in the owner group"() { when: def dynReg = new DynamicRegistrationInfo(resourceId: 'uuid-1', enabled: false, idOfOwner: "testingGroupAAA", applicationType: 'apptype', - approved: true, contacts: 'contacts', jwks: 'jwks', logoUri: 'logouri', policyUri: 'policyuri', + approved: true, contacts: 'contacts', jwks: 'jwks', logoUri: 'logouri', policyUri: 'policyuri', name: 'foo', redirectUris: 'redirecturis', responseTypes: 'responsetypes', scope: 'scope', subjectType: 'subjecttype', tokenEndpointAuthMethod: 'token', tosUri: 'tosuri', grantType: GrantType.implicit) def dri = repo.saveAndFlush(dynReg) @@ -441,7 +441,7 @@ class DynamicRegistrationControllerTests extends AbstractBaseDataJpaTest { def "PUT /DynamicRegistration update group as admin"() { given: def dynReg = new DynamicRegistrationInfo(resourceId: 'uuid-1', enabled: false, idOfOwner: "AAA", applicationType: 'apptype', - approved: true, contacts: 'contacts', jwks: 'jwks', logoUri: 'logouri', policyUri: 'policyuri', + approved: true, contacts: 'contacts', jwks: 'jwks', logoUri: 'logouri', policyUri: 'policyuri', name: 'foo', redirectUris: 'redirecturis', responseTypes: 'responsetypes', scope: 'scope', subjectType: 'subjecttype', tokenEndpointAuthMethod: 'token', tosUri: 'tosuri', grantType: GrantType.implicit) repo.saveAndFlush(dynReg) @@ -493,7 +493,7 @@ class DynamicRegistrationControllerTests extends AbstractBaseDataJpaTest { def "PUT /DynamicRegistration update group as user shouldn't work "() { given: def dynReg = new DynamicRegistrationInfo(resourceId: 'uuid-1', enabled: false, idOfOwner: "testingGroupBBB", applicationType: 'apptype', - approved: true, contacts: 'contacts', jwks: 'jwks', logoUri: 'logouri', policyUri: 'policyuri', + approved: true, contacts: 'contacts', jwks: 'jwks', logoUri: 'logouri', policyUri: 'policyuri', name: 'foo', redirectUris: 'redirecturis', responseTypes: 'responsetypes', scope: 'scope', subjectType: 'subjecttype', tokenEndpointAuthMethod: 'token', tosUri: 'tosuri', grantType: GrantType.implicit) repo.saveAndFlush(dynReg)