Skip to content

Commit a891cc4

Browse files
fix: delete the products
1 parent e43d53b commit a891cc4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/benchmark/java/com/commercetools/sync/benchmark/ProductTypeSyncBenchmark.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import static com.commercetools.sync.benchmark.BenchmarkUtils.*;
44
import static com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics.assertThat;
5+
import static com.commercetools.sync.integration.commons.utils.ProductITUtils.deleteAllProducts;
56
import static com.commercetools.sync.integration.commons.utils.ProductTypeITUtils.ATTRIBUTE_DEFINITION_DRAFT_1;
67
import static com.commercetools.sync.integration.commons.utils.ProductTypeITUtils.deleteProductTypes;
78
import static com.commercetools.sync.integration.commons.utils.TestClientUtils.CTP_TARGET_CLIENT;
@@ -50,12 +51,15 @@ class ProductTypeSyncBenchmark {
5051

5152
@AfterAll
5253
static void tearDown() {
54+
deleteAllProducts(CTP_TARGET_CLIENT);
5355
deleteProductTypes(CTP_TARGET_CLIENT);
5456
}
5557

5658
@BeforeEach
5759
void setupTest() {
5860
clearSyncTestCollections();
61+
// Delete products first because they reference product types
62+
deleteAllProducts(CTP_TARGET_CLIENT);
5963
deleteProductTypes(CTP_TARGET_CLIENT);
6064
productTypeSyncOptions = buildSyncOptions();
6165
}

0 commit comments

Comments
 (0)