diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ResourcePolicyRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ResourcePolicyRestRepositoryIT.java index e5020f601f..777d116cdd 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ResourcePolicyRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ResourcePolicyRestRepositoryIT.java @@ -2574,4 +2574,24 @@ public class ResourcePolicyRestRepositoryIT extends AbstractControllerIntegratio .andExpect(jsonPath("$.page.totalPages", is(4))) .andExpect(jsonPath("$.page.totalElements", is(4))); } + + @Test + public void resourcepolicySerchMethodWithSingleModelTest() throws Exception { + String tokenAdmin = getAuthToken(admin.getEmail(), password); + getClient(tokenAdmin).perform(get("/api/authz/resourcepolicy/search")) + .andExpect(status().isNotFound()); + } + + @Test + public void resourcepolicySerchMethodWithPluralModelTest() throws Exception { + String tokenAdmin = getAuthToken(admin.getEmail(), password); + getClient(tokenAdmin).perform(get("/api/authz/resourcepolicies/search")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._links.eperson.href", Matchers.allOf( + Matchers.containsString("/api/authz/resourcepolicies/search/eperson")))) + .andExpect(jsonPath("$._links.group.href", Matchers.allOf( + Matchers.containsString("/api/authz/resourcepolicies/search/group")))) + .andExpect(jsonPath("$._links.resource.href", Matchers.allOf( + Matchers.containsString("/api/authz/resourcepolicies/search/resource")))); + } } diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionCCLicenseUrlRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionCCLicenseUrlRepositoryIT.java index 84fe06ce19..bea607a86d 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionCCLicenseUrlRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionCCLicenseUrlRepositoryIT.java @@ -14,6 +14,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import org.dspace.app.rest.test.AbstractControllerIntegrationTest; +import org.hamcrest.Matchers; import org.junit.Test; /** @@ -96,4 +97,20 @@ public class SubmissionCCLicenseUrlRepositoryIT extends AbstractControllerIntegr .andExpect(status().isUnauthorized()); } + + @Test + public void submissionCCLicenseUrlSerchMethodWithSingleModelTest() throws Exception { + String tokenAdmin = getAuthToken(admin.getEmail(), password); + getClient(tokenAdmin).perform(get("/api/config/submissioncclicenseUrl/search")) + .andExpect(status().isNotFound()); + } + + @Test + public void submissionCCLicenseUrlSerchMethodWithPluralModelTest() throws Exception { + String tokenAdmin = getAuthToken(admin.getEmail(), password); + getClient(tokenAdmin).perform(get("/api/config/submissioncclicenseUrls/search")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._links.rightsByQuestions.href", Matchers.allOf(Matchers + .containsString("/api/config/submissioncclicenseUrls/search/rightsByQuestions")))); + } } diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/TaskRestRepositoriesIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/TaskRestRepositoriesIT.java index a7813601ec..9f8169e495 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/TaskRestRepositoriesIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/TaskRestRepositoriesIT.java @@ -3092,4 +3092,36 @@ public class TaskRestRepositoriesIT extends AbstractControllerIntegrationTest { bibtex.close(); } + @Test + public void poolTaskSerchMethodWithSingleModelTest() throws Exception { + String tokenAdmin = getAuthToken(admin.getEmail(), password); + getClient(tokenAdmin).perform(get("/api/workflow/pooltask/search")) + .andExpect(status().isNotFound()); + } + + @Test + public void claimedtaskSerchMethodWithSingleModelTest() throws Exception { + String tokenAdmin = getAuthToken(admin.getEmail(), password); + getClient(tokenAdmin).perform(get("/api/workflow/claimedtask/search")) + .andExpect(status().isNotFound()); + } + + @Test + public void poolTaskSerchMethodWithPluralModelTest() throws Exception { + String tokenAdmin = getAuthToken(admin.getEmail(), password); + getClient(tokenAdmin).perform(get("/api/workflow/pooltasks/search")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._links.findByUser.href", Matchers.allOf( + Matchers.containsString("/api/workflow/pooltasks/search/findByUser")))); + } + + @Test + public void claimedtaskSerchMethodWithPluralModelTest() throws Exception { + String tokenAdmin = getAuthToken(admin.getEmail(), password); + getClient(tokenAdmin).perform(get("/api/workflow/claimedtasks/search")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._links.findByUser.href", Matchers.allOf( + Matchers.containsString("/api/workflow/claimedtasks/search/findByUser")))); + } + } diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/VocabularyEntryDetailsIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/VocabularyEntryDetailsIT.java index e5eab1aa98..4962e1aef2 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/VocabularyEntryDetailsIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/VocabularyEntryDetailsIT.java @@ -439,4 +439,19 @@ public class VocabularyEntryDetailsIT extends AbstractControllerIntegrationTest ); } + @Test + public void vocabularyEntryDetailSerchMethodWithSingleModelTest() throws Exception { + String tokenAdmin = getAuthToken(admin.getEmail(), password); + getClient(tokenAdmin).perform(get("/api/submission/vocabularyEntryDetail/search")) + .andExpect(status().isNotFound()); + } + + @Test + public void vocabularyEntryDetailSerchMethodWithPluralModelTest() throws Exception { + String tokenAdmin = getAuthToken(admin.getEmail(), password); + getClient(tokenAdmin).perform(get("/api/submission/vocabularyEntryDetails/search")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._links.top.href", Matchers.allOf( + Matchers.containsString("/api/submission/vocabularyEntryDetails/search/top")))); + } }