mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
updated tests to reflect that registering with an existing email address no longer throws an unprocessable exception
This commit is contained in:
@@ -226,7 +226,7 @@ public class RegistrationRestRepositoryIT extends AbstractControllerIntegrationT
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRegisterDomainNotRegisteredMailAddressRegistred() throws Exception {
|
||||
public void testRegisterMailAddressRegistered() throws Exception {
|
||||
List<RegistrationData> registrationDataList = registrationDataDAO.findAll(context, RegistrationData.class);
|
||||
try {
|
||||
context.turnOffAuthorisationSystem();
|
||||
@@ -236,7 +236,7 @@ public class RegistrationRestRepositoryIT extends AbstractControllerIntegrationT
|
||||
.withCanLogin(true)
|
||||
.build();
|
||||
context.restoreAuthSystemState();
|
||||
configurationService.setProperty("authentication-password.domain.valid", "test.com");
|
||||
|
||||
RegistrationRest registrationRest = new RegistrationRest();
|
||||
registrationRest.setEmail(email);
|
||||
|
||||
@@ -245,9 +245,10 @@ public class RegistrationRestRepositoryIT extends AbstractControllerIntegrationT
|
||||
.param(TYPE_QUERY_PARAM, TYPE_REGISTER)
|
||||
.content(mapper.writeValueAsBytes(registrationRest))
|
||||
.contentType(contentType))
|
||||
.andExpect(status().isUnprocessableEntity());
|
||||
.andExpect(status().isCreated());
|
||||
registrationDataList = registrationDataDAO.findAll(context, RegistrationData.class);
|
||||
assertEquals(0, registrationDataList.size());
|
||||
assertEquals(1, registrationDataList.size());
|
||||
assertTrue(StringUtils.equalsIgnoreCase(registrationDataList.get(0).getEmail(), email));
|
||||
} finally {
|
||||
Iterator<RegistrationData> iterator = registrationDataList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
|
Reference in New Issue
Block a user