From: remillet Date: Sat, 16 Apr 2016 01:24:42 +0000 (-0700) Subject: CSPACE-6937: Fixed what appears to have been a bug in how we handle soft-deletes... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=bb207f5efd9fe82badf9d50b51e1cf0bf4000a4f;p=tmp%2Fjakarta-migration.git CSPACE-6937: Fixed what appears to have been a bug in how we handle soft-deletes of relationships. But it appears the App layer never tries to soft-delete relationship records. --- diff --git a/services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java b/services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java index 7c2247f40..6f5ccd4c2 100644 --- a/services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java +++ b/services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java @@ -134,9 +134,33 @@ public class RelationServiceTest extends AbstractPoxServiceTestImpl wrapDoc, TransitionDef transitionDef) - throws Exception { - String workflowState = transitionDef.getDestinationState(); - if (subjectOrObjectInWorkflowState(wrapDoc, workflowState) == true) { + throws Exception { + if (subjectOrObjectInWorkflowState(wrapDoc, WorkflowClient.WORKFLOWSTATE_LOCKED) == true) { throw new ServiceException(HttpURLConnection.HTTP_FORBIDDEN, - "Cannot change a relationship if either end of it is in the workflow state: " + workflowState); + "Cannot change a relationship if either end of it is in the workflow state: " + WorkflowClient.WORKFLOWSTATE_LOCKED); } } @@ -132,7 +131,7 @@ public class RelationDocumentModelHandler // And take care of ensuring all the values for the relation info are correct populateSubjectAndObjectValues(wrapDoc); - // both subject and object cannot be locked + // Neither the subject nor the object can be locked String workflowState = WorkflowClient.WORKFLOWSTATE_LOCKED; if (subjectOrObjectInWorkflowState(wrapDoc, workflowState) == true) { throw new ServiceException(HttpURLConnection.HTTP_FORBIDDEN, @@ -152,7 +151,7 @@ public class RelationDocumentModelHandler @Override public void handleDelete(DocumentWrapper wrapDoc) throws Exception { String workflowState = WorkflowClient.WORKFLOWSTATE_LOCKED; - // both subject and object cannot be locked + // Neither the subject nor the object can be locked if (subjectOrObjectInWorkflowState(wrapDoc, workflowState) == false) { super.handleDelete(wrapDoc); } else {