@@ -68,16 +68,6 @@ void setupTest() {
6868 CategoryITUtils .deleteAllCategories (TestClientUtils .CTP_TARGET_CLIENT );
6969 CategoryITUtils .deleteAllCategories (TestClientUtils .CTP_SOURCE_CLIENT );
7070
71- // Force delete any orphaned categories with specific slugs that deleteAllCategories might miss
72- CategoryITUtils .deleteCategoriesBySlug (
73- TestClientUtils .CTP_TARGET_CLIENT ,
74- Locale .ENGLISH ,
75- List .of ("furniture1-project-source" , "furniture2-project-source" ));
76- CategoryITUtils .deleteCategoriesBySlug (
77- TestClientUtils .CTP_SOURCE_CLIENT ,
78- Locale .ENGLISH ,
79- List .of ("furniture1-project-source" , "furniture2-project-source" ));
80-
8171 CategoryITUtils .ensureCategories (
8272 TestClientUtils .CTP_TARGET_CLIENT , CategoryITUtils .getCategoryDrafts (null , 2 , true ));
8373
@@ -108,7 +98,7 @@ private CategorySyncOptions buildCategorySyncOptions(final int batchSize) {
10898 */
10999 @ AfterEach
110100 void cleanupAfterTest () {
111- // Clean up, including any categories without keys
101+ // Clean up specific problematic slugs first ( categories without keys from failed tests)
112102 CategoryITUtils .deleteCategoriesBySlug (
113103 TestClientUtils .CTP_TARGET_CLIENT ,
114104 Locale .ENGLISH ,
@@ -117,7 +107,8 @@ void cleanupAfterTest() {
117107 TestClientUtils .CTP_SOURCE_CLIENT ,
118108 Locale .ENGLISH ,
119109 List .of ("furniture1-project-source" , "furniture2-project-source" ));
120-
110+
111+ // Then clean up everything else
121112 CategoryITUtils .deleteAllCategories (TestClientUtils .CTP_TARGET_CLIENT );
122113 CategoryITUtils .deleteAllCategories (TestClientUtils .CTP_SOURCE_CLIENT );
123114 }
@@ -516,14 +507,13 @@ void syncDrafts_fromCategoriesWithoutKeys_ShouldNotUpdateCategories() {
516507 CompletableFuture .allOf (futureCreations .toArray (new CompletableFuture [futureCreations .size ()]))
517508 .join ();
518509
519- // Create two categories in the target without Keys (sequentially to avoid race conditions) .
510+ // Create two categories in the target without Keys.
520511 final CategoryDraft newCategoryDraft1 =
521512 CategoryDraftBuilder .of (oldCategoryDraft1 ).key (null ).build ();
522513 final CategoryDraft newCategoryDraft2 =
523514 CategoryDraftBuilder .of (oldCategoryDraft2 ).key (null ).build ();
524515
525516 TestClientUtils .CTP_TARGET_CLIENT .categories ().create (newCategoryDraft1 ).executeBlocking ();
526-
527517 TestClientUtils .CTP_TARGET_CLIENT .categories ().create (newCategoryDraft2 ).executeBlocking ();
528518
529519 // ---------
0 commit comments