Skip to content

Commit a54d392

Browse files
fix: test
1 parent 9411ad7 commit a54d392

File tree

1 file changed

+11
-1
lines changed
  • src/integration-test/java/com/commercetools/sync/integration/ctpprojectsource/categories

1 file changed

+11
-1
lines changed

src/integration-test/java/com/commercetools/sync/integration/ctpprojectsource/categories/CategorySyncIT.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ static void setup() {
6767
void setupTest() {
6868
CategoryITUtils.deleteAllCategories(TestClientUtils.CTP_TARGET_CLIENT);
6969
CategoryITUtils.deleteAllCategories(TestClientUtils.CTP_SOURCE_CLIENT);
70+
71+
// Clean up any categories without keys that deleteAllCategories() might have missed
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"));
7080

7181
CategoryITUtils.ensureCategories(
7282
TestClientUtils.CTP_TARGET_CLIENT, CategoryITUtils.getCategoryDrafts(null, 2, true));
@@ -486,7 +496,7 @@ void syncDrafts_fromCategoriesWithoutKeys_ShouldNotUpdateCategories() {
486496
CompletableFuture.allOf(futureCreations.toArray(new CompletableFuture[futureCreations.size()]))
487497
.join();
488498

489-
// Delete any existing categories in TARGET with the same slugs to avoid conflicts
499+
// Ensure TARGET is clean before creating categories without keys (defensive cleanup)
490500
CategoryITUtils.deleteCategoriesBySlug(
491501
TestClientUtils.CTP_TARGET_CLIENT,
492502
Locale.ENGLISH,

0 commit comments

Comments
 (0)