From 0d8b6ef853aef90b5ae97ef80bfb4860898909f7 Mon Sep 17 00:00:00 2001 From: Kacper Magdziarz <95610011+kmagdziarz@users.noreply.github.com> Date: Fri, 17 Nov 2023 15:02:14 +0100 Subject: [PATCH] [ACS-6234] Fix: GetProcessesCoreTests::getProcessesOrderedByIdDESC test keeps failing (#2325) --- .../processes/GetProcessesCoreTests.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/GetProcessesCoreTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/GetProcessesCoreTests.java index 6e92984c06..21f5baf9e8 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/GetProcessesCoreTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/GetProcessesCoreTests.java @@ -4,18 +4,14 @@ import org.alfresco.dataprep.CMISUtil.DocumentType; import org.alfresco.rest.RestTest; import org.alfresco.rest.exception.JsonToModelConversionException; import org.alfresco.rest.model.RestProcessDefinitionModel; -import org.alfresco.rest.model.RestProcessModel; import org.alfresco.rest.model.RestProcessModelsCollection; import org.alfresco.utility.model.*; import org.alfresco.utility.testrail.ExecutionType; import org.alfresco.utility.testrail.annotation.TestRail; import org.springframework.http.HttpStatus; import org.testng.annotations.BeforeClass; -import org.testng.annotations.Ignore; import org.testng.annotations.Test; -import java.util.List; - /** * * @author Cristina Axinte @@ -48,18 +44,16 @@ public class GetProcessesCoreTests extends RestTest @TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION, description = "Verify user gets all processes started by him ordered descending by id") - @Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION }, enabled = false) - @Ignore("Until ACS-6234 is done") + @Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION }) public void getProcessesOrderedByIdDESC() { RestProcessModelsCollection processes = restClient.authenticateUser(userWhoStartsTask).withParams("orderBy=id DESC") .withWorkflowAPI().getProcesses(); + restClient.assertStatusCodeIs(HttpStatus.OK); - processes.assertThat().entriesListIsNotEmpty(); - List processesList = processes.getEntries(); - processesList.get(0).onModel().assertThat().field("id").is(process3.getId()); - processesList.get(1).onModel().assertThat().field("id").is(task2.getProcessId()); - processesList.get(2).onModel().assertThat().field("id").is(task1.getProcessId()); + processes.assertThat().entriesListIsNotEmpty() + .and().entriesListIsSortedDescBy("id") + .and().entrySetContains("id", task1.getProcessId(), task2.getProcessId(), process3.getId()); } @TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,