108915: Added additional tests to prevent incorrect endpoints from being reintroduced again

This commit is contained in:
Alexandre Vryghem
2024-02-21 22:17:50 +01:00
parent 081aba85d1
commit a55d147229
2 changed files with 13 additions and 0 deletions

View File

@@ -109,6 +109,12 @@ public class CommunityRestRepositoryIT extends AbstractControllerIntegrationTest
private EPerson collectionAdmin;
private EPerson submitter;
@Test
public void singularEndpointShouldNotExist() throws Exception {
getClient().perform(get("/api/core/community"))
.andExpect(status().isNotFound());
}
@Test
public void createTest() throws Exception {
ObjectMapper mapper = new ObjectMapper();

View File

@@ -265,6 +265,13 @@ public class EPersonRestRepositoryIT extends AbstractControllerIntegrationTest {
;
}
@Test
public void singularEndpointShouldNotExist() throws Exception {
String authToken = getAuthToken(admin.getEmail(), password);
getClient(authToken).perform(get("/api/eperson/eperson"))
.andExpect(status().isNotFound());
}
@Test
public void findAllUnauthorizedTest() throws Exception {
// Access endpoint without being authenticated