RM-5733 Changed the way retention as of date is calculated.

This commit is contained in:
Roxana Lucanu-Ghetu
2018-02-02 16:11:38 +02:00
parent 72b4fc4011
commit 4c42b2cdf6
5 changed files with 32 additions and 19 deletions

View File

@@ -102,7 +102,7 @@ public class BroadcastDispositionActionDefinitionUpdateActionUnitTest
when(mockAction.getName()).thenReturn("mockAction");
// Set up the disposition service to return a known "disposition as of" date.
Date asOfDate = new Date();
when(mockDispositionService.calculateAsOfDate(CONTENT_NODE_REF, mockDispositionActionDefinition, false))
when(mockDispositionService.calculateAsOfDate(CONTENT_NODE_REF, mockDispositionActionDefinition))
.thenReturn(asOfDate);
// Call the method under test.
@@ -160,7 +160,7 @@ public class BroadcastDispositionActionDefinitionUpdateActionUnitTest
when(mockAction.getParameterValue(CHANGED_PROPERTIES)).thenReturn((Serializable) asList(PROP_DISPOSITION_PERIOD_PROPERTY));
// Set up the expected "as of" date.
Date newAsOfDate = new Date(123456789000L);
when(mockDispositionService.calculateAsOfDate(recordNode, mockActionDefinition, false)).thenReturn(newAsOfDate);
when(mockDispositionService.calculateAsOfDate(recordNode, mockActionDefinition)).thenReturn(newAsOfDate);
// Call the method under test.
action.executeImpl(mockAction, definitionNode);

View File

@@ -82,7 +82,7 @@ public class DispositionServiceImplUnitTest
when(mockPeriod.getNextDate(createdDate)).thenReturn(nextDate);
// Call the method under test.
Date asOfDate = dispositionService.calculateAsOfDate(CONTENT_NODE_REF, mockDispositionActionDefinition, true);
Date asOfDate = dispositionService.calculateAsOfDate(CONTENT_NODE_REF, mockDispositionActionDefinition);
assertEquals("Unexpected calculation for 'as of' date", nextDate, asOfDate);
}
@@ -95,7 +95,7 @@ public class DispositionServiceImplUnitTest
when(mockDispositionActionDefinition.getPeriod()).thenReturn(null);
// Call the method under test.
Date asOfDate = dispositionService.calculateAsOfDate(CONTENT_NODE_REF, mockDispositionActionDefinition, true);
Date asOfDate = dispositionService.calculateAsOfDate(CONTENT_NODE_REF, mockDispositionActionDefinition);
assertNull("It should not be possible to determine the 'as of' date.", asOfDate);
}