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);
|
authorizeService.removePoliciesActionFilter(context, eperson, Constants.WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
public void patchCollectionMetadataAuthorized() throws Exception {
|
public void patchCollectionMetadataAuthorized() throws Exception {
|
||||||
runPatchMetadataTests(admin, 200);
|
runPatchMetadataTests(admin, 200);
|
||||||
}
|
}
|
||||||
|
@@ -913,6 +913,7 @@ public class WorkflowItemRestRepositoryIT extends AbstractControllerIntegrationT
|
|||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
|
@Test
|
||||||
public void validationErrorsRequiredMetadataTest() throws Exception {
|
public void validationErrorsRequiredMetadataTest() throws Exception {
|
||||||
context.turnOffAuthorisationSystem();
|
context.turnOffAuthorisationSystem();
|
||||||
|
|
||||||
@@ -936,6 +937,7 @@ public class WorkflowItemRestRepositoryIT extends AbstractControllerIntegrationT
|
|||||||
XmlWorkflowItem witem = WorkflowItemBuilder.createWorkflowItem(context, col1)
|
XmlWorkflowItem witem = WorkflowItemBuilder.createWorkflowItem(context, col1)
|
||||||
.withTitle("Workflow Item 1")
|
.withTitle("Workflow Item 1")
|
||||||
.withIssueDate("2017-10-17")
|
.withIssueDate("2017-10-17")
|
||||||
|
.grantLicense()
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
//4. a workflow item without the dateissued required field
|
//4. a workflow item without the dateissued required field
|
||||||
@@ -947,12 +949,12 @@ public class WorkflowItemRestRepositoryIT extends AbstractControllerIntegrationT
|
|||||||
|
|
||||||
String authToken = getAuthToken(eperson.getEmail(), password);
|
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(status().isOk())
|
||||||
.andExpect(jsonPath("$.errors").doesNotExist())
|
.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(status().isOk())
|
||||||
.andExpect(jsonPath("$.errors[?(@.message=='error.validation.required')]",
|
.andExpect(jsonPath("$.errors[?(@.message=='error.validation.required')]",
|
||||||
Matchers.contains(
|
Matchers.contains(
|
||||||
|
@@ -2621,6 +2621,7 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
(witem, "Workspace Item 1", "2019-01-01", "ExtraEntry"))));
|
(witem, "Workspace Item 1", "2019-01-01", "ExtraEntry"))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
public void patchReplaceMetadataOnItemStillInSubmissionTest() throws Exception {
|
public void patchReplaceMetadataOnItemStillInSubmissionTest() throws Exception {
|
||||||
context.turnOffAuthorisationSystem();
|
context.turnOffAuthorisationSystem();
|
||||||
|
|
||||||
@@ -5922,6 +5923,7 @@ public class WorkspaceItemRestRepositoryIT extends AbstractControllerIntegration
|
|||||||
.andExpect(jsonPath("$.sections.upload.files[0].accessConditions", empty()));
|
.andExpect(jsonPath("$.sections.upload.files[0].accessConditions", empty()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
public void deleteWorkspaceItemWithMinRelationshipsTest() throws Exception {
|
public void deleteWorkspaceItemWithMinRelationshipsTest() throws Exception {
|
||||||
context.turnOffAuthorisationSystem();
|
context.turnOffAuthorisationSystem();
|
||||||
|
|
||||||
@@ -7964,6 +7966,7 @@ ResourcePolicyBuilder.createResourcePolicy(context, null, adminGroup)
|
|||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
public void verifyBitstreamPolicyNotDuplicatedTest() throws Exception {
|
public void verifyBitstreamPolicyNotDuplicatedTest() throws Exception {
|
||||||
context.turnOffAuthorisationSystem();
|
context.turnOffAuthorisationSystem();
|
||||||
|
|
||||||
|
@@ -459,6 +459,7 @@ public class RequestCopyFeatureIT extends AbstractControllerIntegrationTest {
|
|||||||
.andExpect(jsonPath("$._embedded").doesNotExist());
|
.andExpect(jsonPath("$._embedded").doesNotExist());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
public void requestACopyItemTypeLoggedAsAnonymous() throws Exception {
|
public void requestACopyItemTypeLoggedAsAnonymous() throws Exception {
|
||||||
configurationService.setProperty("request.item.type", "logged");
|
configurationService.setProperty("request.item.type", "logged");
|
||||||
|
|
||||||
@@ -493,6 +494,7 @@ public class RequestCopyFeatureIT extends AbstractControllerIntegrationTest {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
public void requestACopyItemTypeEmptyAsAnonymous() throws Exception {
|
public void requestACopyItemTypeEmptyAsAnonymous() throws Exception {
|
||||||
configurationService.setProperty("request.item.type", "");
|
configurationService.setProperty("request.item.type", "");
|
||||||
|
|
||||||
@@ -507,6 +509,7 @@ public class RequestCopyFeatureIT extends AbstractControllerIntegrationTest {
|
|||||||
.andExpect(jsonPath("$._embedded").doesNotExist());
|
.andExpect(jsonPath("$._embedded").doesNotExist());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
public void requestACopyItemTypeEmptyAsEperson() throws Exception {
|
public void requestACopyItemTypeEmptyAsEperson() throws Exception {
|
||||||
configurationService.setProperty("request.item.type", "");
|
configurationService.setProperty("request.item.type", "");
|
||||||
|
|
||||||
@@ -523,6 +526,7 @@ public class RequestCopyFeatureIT extends AbstractControllerIntegrationTest {
|
|||||||
.andExpect(jsonPath("$._embedded").doesNotExist());
|
.andExpect(jsonPath("$._embedded").doesNotExist());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
public void requestACopyItemTypeBogusValueAsAnonymous() throws Exception {
|
public void requestACopyItemTypeBogusValueAsAnonymous() throws Exception {
|
||||||
configurationService.setProperty("request.item.type", "invalid value");
|
configurationService.setProperty("request.item.type", "invalid value");
|
||||||
|
|
||||||
@@ -537,6 +541,7 @@ public class RequestCopyFeatureIT extends AbstractControllerIntegrationTest {
|
|||||||
.andExpect(jsonPath("$._embedded").doesNotExist());
|
.andExpect(jsonPath("$._embedded").doesNotExist());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
public void requestACopyItemTypeBogusValueAsEperson() throws Exception {
|
public void requestACopyItemTypeBogusValueAsEperson() throws Exception {
|
||||||
configurationService.setProperty("request.item.type", "invalid value");
|
configurationService.setProperty("request.item.type", "invalid value");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user