ACS-4966 Correct parent category creation

This commit is contained in:
MichalKinas
2023-04-14 10:00:34 +02:00
parent 7592b637cc
commit 25fa97bdd8

View File

@@ -124,20 +124,20 @@ public class CategoriesPathTests extends CategoriesRestTest
public void testGetChildCategory_includePath() public void testGetChildCategory_includePath()
{ {
STEP("Create parent and child categories"); STEP("Create parent and child categories");
final RestCategoryModel parentCategory = createCategoryModelWithIdAndName("testId", "TestCat"); final List<RestCategoryModel> parentCategories = prepareCategoriesUnderRoot(1);
final RestCategoryModel childCategory = prepareCategoryUnder(parentCategory); final RestCategoryModel childCategory = prepareCategoryUnder(parentCategories.get(0));
STEP("Verify path for created child categories"); STEP("Verify path for created child categories");
final RestCategoryModelsCollection actualCategories = restClient.authenticateUser(user) final RestCategoryModelsCollection actualCategories = restClient.authenticateUser(user)
.withCoreAPI() .withCoreAPI()
.usingCategory(parentCategory) .usingCategory(parentCategories.get(0))
.include(INCLUDE_PATH_PARAM) .include(INCLUDE_PATH_PARAM)
.getCategoryChildren(); .getCategoryChildren();
restClient.assertStatusCodeIs(OK); restClient.assertStatusCodeIs(OK);
actualCategories.getEntries().stream() actualCategories.getEntries().stream()
.map(RestCategoryModel::onModel) .map(RestCategoryModel::onModel)
.forEach(cat -> cat.assertThat().field(FIELD_PATH).is("/categories/General/" + parentCategory.getName())); .forEach(cat -> cat.assertThat().field(FIELD_PATH).is("/categories/General/" + parentCategories.get(0).getName()));
} }
/** /**