diff --git a/source/test-java/org/alfresco/rest/workflow/api/impl/ProcessesImplTest.java b/source/test-java/org/alfresco/rest/workflow/api/impl/ProcessesImplTest.java index 7e68295e43..0087964ff7 100644 --- a/source/test-java/org/alfresco/rest/workflow/api/impl/ProcessesImplTest.java +++ b/source/test-java/org/alfresco/rest/workflow/api/impl/ProcessesImplTest.java @@ -59,6 +59,16 @@ import org.springframework.context.ApplicationContext; */ public class ProcessesImplTest extends TestCase { + private static final String[] CONFIG_LOCATIONS = new String[ApplicationContextHelper.CONFIG_LOCATIONS.length + 2]; + static + { + System.arraycopy(ApplicationContextHelper.CONFIG_LOCATIONS, 0, CONFIG_LOCATIONS, 0, ApplicationContextHelper.CONFIG_LOCATIONS.length); + int index = ApplicationContextHelper.CONFIG_LOCATIONS.length; + CONFIG_LOCATIONS[index++] = "classpath:alfresco/public-rest-context.xml"; + CONFIG_LOCATIONS[index++] = "classpath:alfresco/web-scripts-application-context.xml"; + } + + private static final int ACTIVE_WORKFLOWS_INITIAL_AMOUNT = 25; @@ -70,7 +80,7 @@ public class ProcessesImplTest extends TestCase private static final String QUERY_STATUS_ACTIVE = "(status=active)"; - private ApplicationContext applicationContext = ApplicationContextHelper.getApplicationContext(); + private ApplicationContext applicationContext = ApplicationContextHelper.getApplicationContext(CONFIG_LOCATIONS); private WorkflowService workflowService; diff --git a/source/test-java/org/alfresco/rest/workflow/api/tests/ProcessWorkflowApiTest.java b/source/test-java/org/alfresco/rest/workflow/api/tests/ProcessWorkflowApiTest.java index 1cf0cd7776..4845efbdcb 100644 --- a/source/test-java/org/alfresco/rest/workflow/api/tests/ProcessWorkflowApiTest.java +++ b/source/test-java/org/alfresco/rest/workflow/api/tests/ProcessWorkflowApiTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2012 Alfresco Software Limited. + * Copyright (C) 2005-2014 Alfresco Software Limited. * * This file is part of Alfresco * @@ -921,7 +921,10 @@ public class ProcessWorkflowApiTest extends EnterpriseWorkflowTestApi assertEquals(2l, paginationJSON.get("count")); assertEquals(3l, paginationJSON.get("totalItems")); assertEquals(1l, paginationJSON.get("skipCount")); - assertEquals(true, paginationJSON.get("hasMoreItems")); + + // MNT-10977: Workflow process retrieval returns incorrect hasMoreItems value + // Repository must answer 'false' for 'hasMoreItems' since the total number of items is 3, 2 items are requested and 1 is skipped + assertEquals(false, paginationJSON.get("hasMoreItems")); jsonEntries = (JSONArray) processListJSONObject.get("entries"); assertEquals(2, jsonEntries.size()); @@ -936,7 +939,10 @@ public class ProcessWorkflowApiTest extends EnterpriseWorkflowTestApi assertEquals(1l, paginationJSON.get("count")); assertEquals(3l, paginationJSON.get("totalItems")); assertEquals(2l, paginationJSON.get("skipCount")); - assertEquals(true, paginationJSON.get("hasMoreItems")); + + // MNT-10977: Workflow process retrieval returns incorrect hasMoreItems value + // Repository must answer 'false' for 'hasMoreItems' since the total number of items is 3 and 2 items are skipped + assertEquals(false, paginationJSON.get("hasMoreItems")); jsonEntries = (JSONArray) processListJSONObject.get("entries"); assertEquals(1, jsonEntries.size()); }