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 @Test
public void findAuthorizedByCommunityWithoutUUIDTest() throws Exception { public void findAuthorizedByCommunityWithoutUUIDTest() throws Exception {
getClient().perform(get("/api/core/collections/search/findAuthorizedByCommunity")) getClient().perform(get("/api/core/collections/search/findAuthorizedByCommunity"))
.andExpect(status().isUnprocessableEntity()); .andExpect(status().isBadRequest());
} }
@Test @Test

View File

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

View File

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

View File

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