mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-15 14:03:17 +00:00
Fix errorprone discovered issues. Many tests are missing @Test annotation. Once enabled, a broken test was found & fixed in WorkflowItemRestRepositoryIT.
This commit is contained in:
@@ -1469,6 +1469,7 @@ public class CollectionRestRepositoryIT extends AbstractControllerIntegrationTes
|
||||
authorizeService.removePoliciesActionFilter(context, eperson, Constants.WRITE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void patchCollectionMetadataAuthorized() throws Exception {
|
||||
runPatchMetadataTests(admin, 200);
|
||||
}
|
||||
|
@@ -913,6 +913,7 @@ public class WorkflowItemRestRepositoryIT extends AbstractControllerIntegrationT
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
public void validationErrorsRequiredMetadataTest() throws Exception {
|
||||
context.turnOffAuthorisationSystem();
|
||||
|
||||
@@ -936,6 +937,7 @@ public class WorkflowItemRestRepositoryIT extends AbstractControllerIntegrationT
|
||||
XmlWorkflowItem witem = WorkflowItemBuilder.createWorkflowItem(context, col1)
|
||||
.withTitle("Workflow Item 1")
|
||||
.withIssueDate("2017-10-17")
|
||||
.grantLicense()
|
||||
.build();
|
||||
|
||||
//4. a workflow item without the dateissued required field
|
||||
@@ -947,12 +949,12 @@ public class WorkflowItemRestRepositoryIT extends AbstractControllerIntegrationT
|
||||
|
||||
String authToken = getAuthToken(eperson.getEmail(), password);
|
||||
|
||||
getClient(authToken).perform(get("/api/workflow/worfklowitems/" + witem.getID()))
|
||||
getClient(authToken).perform(get("/api/workflow/workflowitems/" + witem.getID()))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$.errors").doesNotExist())
|
||||
;
|
||||
|
||||
getClient(authToken).perform(get("/api/workflow/worfklowitems/" + witemMissingFields.getID()))
|
||||
getClient(authToken).perform(get("/api/workflow/workflowitems/" + witemMissingFields.getID()))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$.errors[?(@.message=='error.validation.required')]",
|
||||
Matchers.contains(
|
||||
|
@@ -2621,6 +2621,7 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
||||
(witem, "Workspace Item 1", "2019-01-01", "ExtraEntry"))));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void patchReplaceMetadataOnItemStillInSubmissionTest() throws Exception {
|
||||
context.turnOffAuthorisationSystem();
|
||||
|
||||
@@ -5922,6 +5923,7 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
||||
.andExpect(jsonPath("$.sections.upload.files[0].accessConditions", empty()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void deleteWorkspaceItemWithMinRelationshipsTest() throws Exception {
|
||||
context.turnOffAuthorisationSystem();
|
||||
|
||||
@@ -7964,6 +7966,7 @@ ResourcePolicyBuilder.createResourcePolicy(context, null, adminGroup)
|
||||
)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifyBitstreamPolicyNotDuplicatedTest() throws Exception {
|
||||
context.turnOffAuthorisationSystem();
|
||||
|
||||
|
@@ -459,6 +459,7 @@ public class RequestCopyFeatureIT extends AbstractControllerIntegrationTest {
|
||||
.andExpect(jsonPath("$._embedded").doesNotExist());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void requestACopyItemTypeLoggedAsAnonymous() throws Exception {
|
||||
configurationService.setProperty("request.item.type", "logged");
|
||||
|
||||
@@ -493,6 +494,7 @@ public class RequestCopyFeatureIT extends AbstractControllerIntegrationTest {
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void requestACopyItemTypeEmptyAsAnonymous() throws Exception {
|
||||
configurationService.setProperty("request.item.type", "");
|
||||
|
||||
@@ -507,6 +509,7 @@ public class RequestCopyFeatureIT extends AbstractControllerIntegrationTest {
|
||||
.andExpect(jsonPath("$._embedded").doesNotExist());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void requestACopyItemTypeEmptyAsEperson() throws Exception {
|
||||
configurationService.setProperty("request.item.type", "");
|
||||
|
||||
@@ -523,6 +526,7 @@ public class RequestCopyFeatureIT extends AbstractControllerIntegrationTest {
|
||||
.andExpect(jsonPath("$._embedded").doesNotExist());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void requestACopyItemTypeBogusValueAsAnonymous() throws Exception {
|
||||
configurationService.setProperty("request.item.type", "invalid value");
|
||||
|
||||
@@ -537,6 +541,7 @@ public class RequestCopyFeatureIT extends AbstractControllerIntegrationTest {
|
||||
.andExpect(jsonPath("$._embedded").doesNotExist());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void requestACopyItemTypeBogusValueAsEperson() throws Exception {
|
||||
configurationService.setProperty("request.item.type", "invalid value");
|
||||
|
||||
|
Reference in New Issue
Block a user