diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/models/aspects/GetAspectTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/models/aspects/GetAspectTests.java new file mode 100644 index 0000000000..fd1f957c39 --- /dev/null +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/models/aspects/GetAspectTests.java @@ -0,0 +1,54 @@ +package org.alfresco.rest.models.aspects; + +import org.alfresco.rest.RestTest; +import org.alfresco.rest.model.RestAspectModel; +import org.alfresco.rest.model.RestErrorModel; +import org.alfresco.utility.model.TestGroup; +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.Test; + +public class GetAspectTests extends RestTest +{ + + @BeforeClass(alwaysRun=true) + public void dataPreparation() throws Exception + { + restClient.authenticateUser(dataUser.createRandomTestUser()); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = { TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Verify inexistent aspect and status code is Not Found (404)") + public void getInexistentAspect() throws Exception + { + String unknownAspect = "unknown:aspect"; + restClient.withModelAPI().getAspect(unknownAspect); + restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND) + .assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_WAS_NOT_FOUND, unknownAspect)); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = { TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Verify Aspect Info and status code is OK (200)") + public void getAspect() throws Exception + { + RestAspectModel aspect = restClient.withModelAPI().getAspect("cm:titled"); + restClient.assertStatusCodeIs(HttpStatus.OK); + aspect.assertThat().field("associations").isEmpty().and() + .field("mandatoryAspects").isEmpty().and() + .field("properties").isNotEmpty().and() + .field("includedInSupertypeQuery").is(true).and() + .field("isContainer").is(false).and() + .field("id").is("cm:titled").and() + .field("description").is("Titled").and() + .field("title").is("Titled").and() + .field("model.id").is("cm:contentmodel").and() + .field("model.author").is("Alfresco").and() + .field("model.description").is("Alfresco Content Domain Model").and() + .field("model.namespaceUri").is("http://www.alfresco.org/model/content/1.0").and() + .field("model.namespacePrefix").is("cm"); + } +} \ No newline at end of file diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/models/aspects/GetAspectsTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/models/aspects/GetAspectsTests.java new file mode 100644 index 0000000000..1ffbb94199 --- /dev/null +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/models/aspects/GetAspectsTests.java @@ -0,0 +1,199 @@ +package org.alfresco.rest.models.aspects; + +import org.alfresco.rest.RestTest; +import org.alfresco.rest.model.RestAbstractClassModel; +import org.alfresco.rest.model.RestAspectsCollection; +import org.alfresco.utility.model.TestGroup; +import org.alfresco.utility.model.UserModel; +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.Test; + +public class GetAspectsTests extends RestTest +{ + + private UserModel regularUser; + + @BeforeClass(alwaysRun=true) + public void dataPreparation() throws Exception + { + regularUser = dataUser.createRandomTestUser(); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Verify user get aspects and gets status code OK (200)") + public void getAspects() throws Exception + { + RestAspectsCollection aspects = restClient.authenticateUser(regularUser).withModelAPI() + .getAspects(); + restClient.assertStatusCodeIs(HttpStatus.OK); + aspects.assertThat() + .entriesListCountIs(100) + .and().entriesListContains("id", "cm:classifiable") + .and().entriesListContains("id", "cm:author") + .and().entriesListContains("id", "cm:checkedOut"); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Should filter aspects using namespace uri and gets status code OK (200)") + public void getAspectByNamespaceUri() throws Exception + { + RestAspectsCollection aspects = restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(namespaceUri matches('http://www.alfresco.org/model.*'))") + .getAspects(); + restClient.assertStatusCodeIs(HttpStatus.OK); + aspects.assertThat().entriesListCountIs(100); + + aspects = restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(not namespaceUri matches('http://www.alfresco.org/model.*'))") + .getAspects(); + restClient.assertStatusCodeIs(HttpStatus.OK); + aspects.assertThat().entriesListCountIs(0); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Should filter aspects using modelId and gets status code OK (200)") + public void getAspectByModelsIds() throws Exception + { + RestAspectsCollection aspects = restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(modelId in ('cm:contentmodel', 'smf:smartFolder'))") + .getAspects(); + restClient.assertStatusCodeIs(HttpStatus.OK); + aspects.getPagination().assertThat().fieldsCount().is(5).and() + .field("totalItems").isLessThan(65).and() + .field("maxItems").is(100).and() + .field("skipCount").isGreaterThan(0).and() + .field("hasMoreItems").is(false); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Should filter aspects using modelId with subaspects and gets status code OK (200)") + public void getAspectByModelsIdsWithIncludeSubAspects() throws Exception + { + RestAspectsCollection aspects = restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(modelId in ('cm:contentmodel INCLUDESUBASPECTS', 'smf:smartFolder INCLUDESUBASPECTS'))") + .getAspects(); + restClient.assertStatusCodeIs(HttpStatus.OK); + aspects.getPagination().assertThat().fieldsCount().is(5).and() + .field("totalItems").isGreaterThan(65).and() + .field("maxItems").is(100).and() + .field("skipCount").isGreaterThan(0).and() + .field("hasMoreItems").is(false); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Should filter aspects using parentId and gets status code OK (200)") + public void getAspectByParentId() throws Exception + { + RestAspectsCollection aspects = restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(parentId in ('cm:titled'))") + .getAspects(); + restClient.assertStatusCodeIs(HttpStatus.OK); + aspects.getPagination().assertThat().fieldsCount().is(5).and() + .field("totalItems").is(5).and() + .field("hasMoreItems").is(false); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Should Aspects association, properties and mandatory aspects and gets status code OK (200)") + public void getAspectIncludeParams() throws Exception + { + RestAspectsCollection aspects = restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("include=properties,mandatoryAspects,associations") + .getAspects(); + restClient.assertStatusCodeIs(HttpStatus.OK); + + for (RestAbstractClassModel aspect : aspects.getEntries()) + { + aspect.onModel().assertThat() + .field("associations").isNotNull().and() + .field("properties").isNotNull().and() + .field("mandatoryAspects").isNotNull(); + } + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Should verify the query errors with possible options") + public void verifyAspectsQueryError() + { + restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(modelId in (' ')") + .getAspects(); + restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST); + + restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(modelId in ('cm:contentmodel INCLUDESUBASPECTS',))") + .getAspects(); + restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST); + + restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(modelId in ('cm:contentmodel INCLUDESUBTYPES'))") + .getAspects(); + restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST); + + restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(parentId in (' ')") + .getAspects(); + restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST); + + restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(parentId in ('cm:content',))") + .getAspects(); + restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST); + + restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(parentId in ('cm:content',))&include=properties") + .getAspects(); + restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST); + + restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(namespaceUri matches('*'))") + .getAspects(); + restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST); + + restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(parentId in ('cm:content'))&include=properties") + .getAspects(); + restClient.assertStatusCodeIs(HttpStatus.OK); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section={TestGroup.REST_API, TestGroup.MODEL}, executionType= ExecutionType.REGRESSION, + description= "Verify if any user gets aspects with high skipCount and maxItems parameter applied") + public void getPaginationParameter() throws Exception + { + RestAspectsCollection aspects = restClient.authenticateUser(regularUser) + .withModelAPI() + .usingParams("maxItems=10&skipCount=10") + .getAspects(); + aspects.assertThat().entriesListCountIs(10); + aspects.assertThat().paginationField("hasMoreItems").is("true"); + aspects.assertThat().paginationField("skipCount").is("10"); + aspects.assertThat().paginationField("maxItems").is("10"); + restClient.assertStatusCodeIs(HttpStatus.OK); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section={TestGroup.REST_API, TestGroup.MODEL}, executionType= ExecutionType.REGRESSION, + description= "Verify if any user gets aspects with hasMoreItems applied bases on skip count and maxItems") + public void getHighPaginationQuery() throws Exception + { + RestAspectsCollection aspects = restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("maxItems=10&skipCount=150") + .getAspects(); + aspects.assertThat().entriesListCountIs(0); + aspects.assertThat().paginationField("hasMoreItems").is("false"); + aspects.assertThat().paginationField("skipCount").is("150"); + aspects.assertThat().paginationField("maxItems").is("10"); + restClient.assertStatusCodeIs(HttpStatus.OK); + } +} \ No newline at end of file diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/models/types/GetTypeTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/models/types/GetTypeTests.java new file mode 100644 index 0000000000..76ece51720 --- /dev/null +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/models/types/GetTypeTests.java @@ -0,0 +1,55 @@ +package org.alfresco.rest.models.types; + +import org.alfresco.rest.RestTest; +import org.alfresco.rest.model.RestErrorModel; +import org.alfresco.rest.model.RestTypeModel; +import org.alfresco.utility.model.TestGroup; +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.Test; + +public class GetTypeTests extends RestTest +{ + + @BeforeClass(alwaysRun=true) + public void dataPreparation() throws Exception + { + restClient.authenticateUser(dataUser.createRandomTestUser()); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = { TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Verify inexistent type and status code is Not Found (404)") + public void getInexistentType() throws Exception + { + String unknownType = "unknown:type"; + restClient.withModelAPI().getType(unknownType); + restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND) + .assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_WAS_NOT_FOUND, unknownType)); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = { TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Verify Type Info and status code is OK (200)") + public void getType() throws Exception + { + RestTypeModel type = restClient.withModelAPI().getType("cm:content"); + restClient.assertStatusCodeIs(HttpStatus.OK); + type.assertThat().field("associations").isEmpty().and() + .field("mandatoryAspects").isNotEmpty().and() + .field("properties").isNotEmpty().and() + .field("includedInSupertypeQuery").is(true).and() + .field("isArchive").is(true).and() + .field("isContainer").is(false).and() + .field("id").is("cm:content").and() + .field("description").is("Base Content Object").and() + .field("title").is("Content").and() + .field("model.id").is("cm:contentmodel").and() + .field("model.author").is("Alfresco").and() + .field("model.description").is("Alfresco Content Domain Model").and() + .field("model.namespaceUri").is("http://www.alfresco.org/model/content/1.0").and() + .field("model.namespacePrefix").is("cm"); + } +} \ No newline at end of file diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/models/types/GetTypesTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/models/types/GetTypesTests.java new file mode 100644 index 0000000000..4edb26f2e2 --- /dev/null +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/models/types/GetTypesTests.java @@ -0,0 +1,199 @@ +package org.alfresco.rest.models.types; + +import org.alfresco.rest.RestTest; +import org.alfresco.rest.model.RestAbstractClassModel; +import org.alfresco.rest.model.RestTypesCollection; +import org.alfresco.utility.model.TestGroup; +import org.alfresco.utility.model.UserModel; +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.Test; + +public class GetTypesTests extends RestTest +{ + + private UserModel regularUser; + + @BeforeClass(alwaysRun=true) + public void dataPreparation() throws Exception + { + regularUser = dataUser.createRandomTestUser(); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Verify user get types and gets status code OK (200)") + public void getTypes() throws Exception + { + RestTypesCollection types = restClient.authenticateUser(regularUser).withModelAPI() + .getTypes(); + restClient.assertStatusCodeIs(HttpStatus.OK); + types.assertThat() + .entriesListCountIs(100) + .and().entriesListContains("id", "cm:content") + .and().entriesListContains("id", "cm:systemfolder") + .and().entriesListContains("id", "cm:folder"); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Should filter types using namespace uri and gets status code OK (200)") + public void getTypeByNamespaceUri() throws Exception + { + RestTypesCollection types = restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(namespaceUri matches('http://www.alfresco.org/model.*'))") + .getTypes(); + restClient.assertStatusCodeIs(HttpStatus.OK); + types.assertThat().entriesListCountIs(100); + + types = restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(not namespaceUri matches('http://www.alfresco.org/model.*'))") + .getTypes(); + restClient.assertStatusCodeIs(HttpStatus.OK); + types.assertThat().entriesListCountIs(0); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Should filter types using modelId and gets status code OK (200)") + public void getTypeByModelsIds() throws Exception + { + RestTypesCollection types = restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(modelId in ('cm:contentmodel', 'smf:smartFolder'))") + .getTypes(); + restClient.assertStatusCodeIs(HttpStatus.OK); + types.getPagination().assertThat().fieldsCount().is(5).and() + .field("totalItems").isLessThan(65).and() + .field("maxItems").is(100).and() + .field("skipCount").isGreaterThan(0).and() + .field("hasMoreItems").is(false); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Should filter types using modelId with subtypes and gets status code OK (200)") + public void getTypeByModelsIdsWithIncludeSubTypes() throws Exception + { + RestTypesCollection types = restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(modelId in ('cm:contentmodel INCLUDESUBTYPES', 'smf:smartFolder INCLUDESUBTYPES'))") + .getTypes(); + restClient.assertStatusCodeIs(HttpStatus.OK); + types.getPagination().assertThat().fieldsCount().is(5).and() + .field("totalItems").isGreaterThan(65).and() + .field("maxItems").is(100).and() + .field("skipCount").isGreaterThan(0).and() + .field("hasMoreItems").is(false); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Should filter types using parentId and gets status code OK (200)") + public void getTypeByParentId() throws Exception + { + RestTypesCollection types = restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(parentId in ('cm:content'))") + .getTypes(); + restClient.assertStatusCodeIs(HttpStatus.OK); + types.getPagination().assertThat().fieldsCount().is(5).and() + .field("totalItems").isGreaterThan(40).and() + .field("hasMoreItems").is(false); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Should get Type with association, properties and mandatory types and gets status code OK (200)") + public void getTypeIncludeParams() throws Exception + { + RestTypesCollection types = restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("include=properties,mandatoryAspects,associations") + .getTypes(); + restClient.assertStatusCodeIs(HttpStatus.OK); + + for (RestAbstractClassModel type : types.getEntries()) + { + type.onModel().assertThat() + .field("associations").isNotNull().and() + .field("properties").isNotNull().and() + .field("mandatoryAspects").isNotNull(); + } + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION, + description = "Should verify the query errors with possible options") + public void verifyTypesQueryError() throws Exception + { + restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(modelId in (' ')") + .getTypes(); + restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST); + + restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(modelId in ('cm:contentmodel INCLUDESUBTYPES',))") + .getTypes(); + restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST); + + restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(modelId in ('cm:contentmodel INCLUDESUBASPECTS'))") + .getTypes(); + restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST); + + restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(parentId in (' ')") + .getTypes(); + restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST); + + restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(parentId in ('cm:titled',))") + .getTypes(); + restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST); + + restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(parentId in ('cm:titled',))&include=properties") + .getTypes(); + restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST); + + restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(namespaceUri matches('*'))") + .getTypes(); + restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST); + + restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("where=(parentId in ('cm:titled'))&include=properties") + .getTypes(); + restClient.assertStatusCodeIs(HttpStatus.OK); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section={TestGroup.REST_API, TestGroup.MODEL}, executionType= ExecutionType.REGRESSION, + description= "Verify if any user gets types with high skipCount and maxItems parameter applied") + public void getPaginationParameter() throws Exception + { + RestTypesCollection types = restClient.authenticateUser(regularUser) + .withModelAPI() + .usingParams("maxItems=10&skipCount=10") + .getTypes(); + types.assertThat().entriesListCountIs(10); + types.assertThat().paginationField("hasMoreItems").is("true"); + types.assertThat().paginationField("skipCount").is("10"); + types.assertThat().paginationField("maxItems").is("10"); + restClient.assertStatusCodeIs(HttpStatus.OK); + } + + @Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION }) + @TestRail(section={TestGroup.REST_API, TestGroup.MODEL}, executionType= ExecutionType.REGRESSION, + description= "Verify if any user gets types with hasMoreItems applied bases on skip count and maxItems") + public void getHighPaginationQuery() throws Exception + { + RestTypesCollection types = restClient.authenticateUser(regularUser).withModelAPI() + .usingParams("maxItems=10&skipCount=150") + .getTypes(); + types.assertThat().entriesListCountIs(0); + types.assertThat().paginationField("hasMoreItems").is("false"); + types.assertThat().paginationField("skipCount").is("150"); + types.assertThat().paginationField("maxItems").is("10"); + restClient.assertStatusCodeIs(HttpStatus.OK); + } +} \ No newline at end of file diff --git a/packaging/tests/tas-restapi/src/test/resources/test-suites/part3-suite.xml b/packaging/tests/tas-restapi/src/test/resources/test-suites/part3-suite.xml index ed05643430..cf98c3730c 100644 --- a/packaging/tests/tas-restapi/src/test/resources/test-suites/part3-suite.xml +++ b/packaging/tests/tas-restapi/src/test/resources/test-suites/part3-suite.xml @@ -15,6 +15,7 @@ + diff --git a/pom.xml b/pom.xml index fd8ad55053..1df1896873 100644 --- a/pom.xml +++ b/pom.xml @@ -102,9 +102,9 @@ 42.2.19 8.0.23 2.7.2 - 3.0.42 + 3.0.43 3.3.0 - 1.53 + 1.54 1.27 1.8 1.6