mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge release/V2.4 into master.
This commit is contained in:
@@ -108,7 +108,7 @@ public class DispositionLifecycleJobExecuter extends RecordsManagementJobExecute
|
||||
*
|
||||
* @return job query string
|
||||
*/
|
||||
private String getQuery()
|
||||
protected String getQuery()
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
@@ -133,8 +133,8 @@ public class DispositionLifecycleJobExecuter extends RecordsManagementJobExecute
|
||||
}
|
||||
|
||||
sb.append("))");
|
||||
sb.append(" AND ISNULL:\"rma:dispositionActionCompletedAt\" ");
|
||||
sb.append(" + ( ");
|
||||
sb.append(" AND ISUNSET:\"rma:dispositionActionCompletedAt\" ");
|
||||
sb.append(" AND ( ");
|
||||
sb.append("@rma\\:dispositionEventsEligible:true ");
|
||||
sb.append("OR @rma\\:dispositionAsOf:[MIN TO NOW] ");
|
||||
sb.append(") ");
|
||||
|
@@ -19,6 +19,7 @@
|
||||
package org.alfresco.module.org_alfresco_module_rm.job;
|
||||
|
||||
import static org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock.generateQName;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.anyMap;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
@@ -229,4 +230,17 @@ public class DispositionLifecycleJobExecuterUnitTest extends BaseUnitTest
|
||||
// ensure no more interactions
|
||||
verifyNoMoreInteractions(mockedNodeService, mockedRecordsManagementActionService);
|
||||
}
|
||||
|
||||
/**
|
||||
* Brittle unit test that simply checks the generated query is an exact string when the supplied disposition actions
|
||||
* are "CUTOFF" and "RETAIN" (see {@link #before}).
|
||||
*/
|
||||
@Test
|
||||
public void testGetQuery()
|
||||
{
|
||||
String actual = executer.getQuery();
|
||||
|
||||
String expected = "TYPE:\"rma:dispositionAction\" + (@rma\\:dispositionAction:(\"cutoff\" OR \"retain\")) AND ISUNSET:\"rma:dispositionActionCompletedAt\" AND ( @rma\\:dispositionEventsEligible:true OR @rma\\:dispositionAsOf:[MIN TO NOW] ) ";
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user