test - updated: skipCountParameterApplied and maxItemsParameterApplied

This commit is contained in:
mionescu
2017-02-23 10:46:48 +02:00
parent bc22fd01b3
commit 652a570ba1
@@ -42,12 +42,12 @@ public class GetTasksFullTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.FULL })
public void skipCountParameterApplied() throws Exception
{
taskCollections = restClient.authenticateUser(dataUser.getAdminUser()).withParams("orderBy=name ASC").withWorkflowAPI().getTasks();
taskCollections = restClient.authenticateUser(dataUser.getAdminUser()).withParams("orderBy=description ASC").withWorkflowAPI().getTasks();
restClient.assertStatusCodeIs(HttpStatus.OK);
RestTaskModel firstTask = taskCollections.getEntries().get(0).onModel();
RestTaskModel secondTask = taskCollections.getEntries().get(1).onModel();
taskModels = restClient.withParams("skipCount=2&orderBy=name ASC").withWorkflowAPI().getTasks();
taskModels = restClient.withParams("orderBy=description ASC&skipCount=2").withWorkflowAPI().getTasks();
restClient.assertStatusCodeIs(HttpStatus.OK);
taskModels.assertThat().entriesListDoesNotContain("id", firstTask.getId())
.assertThat().entriesListDoesNotContain("id", secondTask.getId());
@@ -59,18 +59,18 @@ public class GetTasksFullTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.FULL })
public void maxItemsParameterApplied() throws Exception
{
taskCollections = restClient.authenticateUser(dataUser.getAdminUser()).withParams("orderBy=name ASC").withWorkflowAPI().getTasks();
taskCollections = restClient.authenticateUser(dataUser.getAdminUser()).withParams("orderBy=description ASC").withWorkflowAPI().getTasks();
restClient.assertStatusCodeIs(HttpStatus.OK);
RestTaskModel firstTask = taskCollections.getEntries().get(0).onModel();
RestTaskModel secondTask = taskCollections.getEntries().get(1).onModel();
taskModels = restClient.withParams("maxItems=2&orderBy=name ASC").withWorkflowAPI().getTasks();
taskModels = restClient.withParams("orderBy=description ASC&maxItems=2").withWorkflowAPI().getTasks();
restClient.assertStatusCodeIs(HttpStatus.OK);
taskModels.assertThat().entriesListContains("id", firstTask.getId())
.assertThat().entriesListContains("id", secondTask.getId());
taskModels.assertThat().paginationField("maxItems").is("2");
taskModels.assertThat().paginationField("count").is("2");
}
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,