@@ -114,23 +114,6 @@ void contactProvisioningExistingUser() throws JsonProcessingException {
114114 assertEquals (Authority .GUEST , userRole .getAuthority ());
115115 }
116116
117- @ Test
118- void contactProvisioningMissingUID () {
119- CRMRole crmRole = new CRMRole ("roleId" , "BVW" , "Super" );
120- //Empty uid will force the InvalidInputException
121- CRMContact crmContact = createCrmContact (CRM_CONTACT_ID , CRM_ORGANIZATION_ID , crmRole , "" , "hardewijk.org" , true );
122-
123- given ()
124- .when ()
125- .accept (ContentType .JSON )
126- .header (API_KEY_HEADER , "secret" )
127- .contentType (ContentType .JSON )
128- .body (crmContact )
129- .post ("/api/internal/v1/crm" )
130- .then ()
131- .statusCode (HttpStatus .BAD_REQUEST .value ());
132- }
133-
134117 @ Test
135118 void contactInviteNewUser () throws Exception {
136119 CRMRole crmRole = new CRMRole ("roleId" , "BVW" , "Super" );
@@ -187,6 +170,35 @@ void contactInviteNewUser() throws Exception {
187170 }
188171
189172 @ Test
173+ void contactInviteNewUserSuppressEmail () throws Exception {
174+ CRMRole crmRole = new CRMRole ("roleId" , "BVW" , "Super" );
175+ String crmContactID = UUID .randomUUID ().toString ();
176+ String crmOrganisationID = UUID .randomUUID ().toString ();
177+ CRMContact crmContact = createCrmContact (crmContactID , crmOrganisationID , crmRole , null , null , true );
178+ //These two applications are linked to the 'BVW' CRM role
179+ super .stubForManageProviderByEntityID (EntityType .OIDC10_RP , "https://calendar" );
180+ super .stubForManageProviderByEntityID (EntityType .SAML20_SP , "https://storage" );
181+
182+ String response = given ()
183+ .when ()
184+ .accept (ContentType .JSON )
185+ .header (API_KEY_HEADER , "secret" )
186+ .contentType (ContentType .JSON )
187+ .body (crmContact )
188+ .post ("/api/internal/v1/crm" )
189+ .then ()
190+ .extract ()
191+ .asString ();
192+ assertEquals ("created" , response );
193+
194+ Optional <User > optionalUser = userRepository .findByCrmContactIdAndCrmOrganisationId (crmContactID ,
195+ crmOrganisationID );
196+ assertTrue (optionalUser .isEmpty ());
197+
198+ List <MimeMessageParser > allMailMessages = allMailMessages (0 );
199+ assertEquals (0 , allMailMessages .size ());
200+ }
201+ @ Test
190202 void contactProvisioningRemoveScimRole () throws JsonProcessingException {
191203 CRMRole crmRoleResearch = new CRMRole ("5e17b508-08e4-e811-8100-005056956c1a" , "CONBEH" , "SURFconextbeheerder" );
192204 CRMRole crmRoleCloud = new CRMRole ("cf652619-08e4-e811-8100-005056956c1a" , "CONVER" , "SURFconextverantwoordelijke" );
0 commit comments