fixed unit tests: missing parameters should return 400 BAD REQUEST

This commit is contained in:
Mykhaylo Boychuk
2020-02-11 09:56:35 +01:00
parent 0a9d4cd4c1
commit 4e080150cb
4 changed files with 5 additions and 5 deletions

View File

@@ -275,7 +275,7 @@ public class CollectionRestRepositoryIT extends AbstractControllerIntegrationTes
@Test
public void findAuthorizedByCommunityWithoutUUIDTest() throws Exception {
getClient().perform(get("/api/core/collections/search/findAuthorizedByCommunity"))
.andExpect(status().isUnprocessableEntity());
.andExpect(status().isBadRequest());
}
@Test

View File

@@ -767,7 +767,7 @@ public class CommunityRestRepositoryIT extends AbstractControllerIntegrationTest
@Test
public void findAllSubCommunitiesWithoutUUID() throws Exception {
getClient().perform(get("/api/core/communities/search/subCommunities"))
.andExpect(status().isUnprocessableEntity());
.andExpect(status().isBadRequest());
}
@Test

View File

@@ -337,7 +337,7 @@ public class EPersonRestRepositoryIT extends AbstractControllerIntegrationTest {
public void findByEmailUnprocessable() throws Exception {
String authToken = getAuthToken(admin.getEmail(), password);
getClient(authToken).perform(get("/api/eperson/epersons/search/byEmail"))
.andExpect(status().isUnprocessableEntity());
.andExpect(status().isBadRequest());
}
@Test
@@ -409,7 +409,7 @@ public class EPersonRestRepositoryIT extends AbstractControllerIntegrationTest {
public void findByNameUnprocessable() throws Exception {
String authToken = getAuthToken(admin.getEmail(), password);
getClient(authToken).perform(get("/api/eperson/epersons/search/byName"))
.andExpect(status().isUnprocessableEntity());
.andExpect(status().isBadRequest());
}
@Test

View File

@@ -165,7 +165,7 @@ public class MetadatafieldRestRepositoryIT extends AbstractControllerIntegration
public void findByNullSchema() throws Exception {
getClient().perform(get("/api/core/metadatafields/search/bySchema"))
.andExpect(status().isUnprocessableEntity());
.andExpect(status().isBadRequest());
}
@Test