From bcaeedb1623d9a6cf5b79f4f462a2f3a81cff05d Mon Sep 17 00:00:00 2001 From: "adam.zakrzewski" Date: Wed, 8 Mar 2023 14:39:47 +0100 Subject: [PATCH] ACS-4779:Count field exists in response for get list of tags even when that field is not included. Other issue is that count field is not present when we do GET call with included count for /tags/{tagId} --- .../org/alfresco/rest/tags/GetTagsTests.java | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/GetTagsTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/GetTagsTests.java index df09490d6c..20b8e41488 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/GetTagsTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/GetTagsTests.java @@ -242,16 +242,13 @@ public class GetTagsTests extends TagsDataPrep */ @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION }) - public void testGetTag_IncludingCount() + public void testGetTag_includingCount() { STEP("Create single tag as admin including count and verify if it is 0"); final RestTagModel tagModel = createTagModelWithName(getRandomName(TAG_NAME_PREFIX).toLowerCase()); final RestTagModel createdTag = restClient.authenticateUser(adminUserModel).withCoreAPI().include(FIELD_COUNT).createSingleTag(tagModel); restClient.assertStatusCodeIs(CREATED); - createdTag.assertThat().field(FIELD_TAG).is(tagModel.getTag()) - .assertThat().field(FIELD_ID).isNotEmpty() - .assertThat().field(FIELD_COUNT).is(0); STEP("Get a single tag, including count and verify if it is 0"); final RestTagModel searchedTag = restClient.withCoreAPI().include(FIELD_COUNT).getTag(createdTag); @@ -266,16 +263,13 @@ public class GetTagsTests extends TagsDataPrep */ @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION }) - public void testGetTag_NotIncludingCount() + public void testGetTag_notIncludingCount() { STEP("Create single tag as admin including count and verify if it is 0"); final RestTagModel tagModel = createTagModelWithName(getRandomName(TAG_NAME_PREFIX).toLowerCase()); final RestTagModel createdTag = restClient.authenticateUser(adminUserModel).withCoreAPI().include(FIELD_COUNT).createSingleTag(tagModel); restClient.assertStatusCodeIs(CREATED); - createdTag.assertThat().field(FIELD_TAG).is(tagModel.getTag()) - .assertThat().field(FIELD_ID).isNotEmpty() - .assertThat().field(FIELD_COUNT).is(0); STEP("Get a single tag, not including count and verify if it is not present in the response"); final RestTagModel searchedTag = restClient.withCoreAPI().getTag(createdTag); @@ -290,16 +284,13 @@ public class GetTagsTests extends TagsDataPrep */ @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION }) - public void testGetTags_IncludingCount() + public void testGetTags_includingCount() { STEP("Create single tag as admin including count and verify if it is 0"); final RestTagModel tagModel = createTagModelWithName(getRandomName(TAG_NAME_PREFIX).toLowerCase()); final RestTagModel createdTag = restClient.authenticateUser(adminUserModel).withCoreAPI().include(FIELD_COUNT).createSingleTag(tagModel); restClient.assertStatusCodeIs(CREATED); - createdTag.assertThat().field(FIELD_TAG).is(tagModel.getTag()) - .assertThat().field(FIELD_ID).isNotEmpty() - .assertThat().field(FIELD_COUNT).is(0); STEP("Get tags including count and verify if it is present int the response"); final RestTagModelsCollection searchedTags = restClient.withCoreAPI().include(FIELD_COUNT).getTags(); @@ -316,16 +307,13 @@ public class GetTagsTests extends TagsDataPrep */ @Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION }) - public void testGetTags_NotIncludingCount() + public void testGetTags_notIncludingCount() { STEP("Create single tag as admin including count and verify if it is 0"); final RestTagModel tagModel = createTagModelWithName(getRandomName(TAG_NAME_PREFIX).toLowerCase()); final RestTagModel createdTag = restClient.authenticateUser(adminUserModel).withCoreAPI().include(FIELD_COUNT).createSingleTag(tagModel); restClient.assertStatusCodeIs(CREATED); - createdTag.assertThat().field(FIELD_TAG).is(tagModel.getTag()) - .assertThat().field(FIELD_ID).isNotEmpty() - .assertThat().field(FIELD_COUNT).is(0); STEP("Get tags, not including count and verify if it is not in the response"); final RestTagModelsCollection searchedTags = restClient.withCoreAPI().getTags();