Skip to content

Commit ad8e39d

Browse files
committed
fix integration tests for custom objects
1 parent bd94c6e commit ad8e39d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

commercetools/commercetools-sdk-java-api/src/integrationTest/java/cleanup/DeleteEverythingIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ private void deleteAllCustomObjects() {
249249
.get()
250250
.executeBlocking().getBody();
251251
response.getResults().forEach(customObject -> {
252-
CustomObjectFixtures.deleteCustomObject(customObject.getId(), customObject.getVersion());
252+
CustomObjectFixtures.deleteCustomObject(customObject.getContainer(), customObject.getKey(), customObject.getVersion());
253253
});
254254
} while (response.getResults().size() != 0);
255255
}

commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/custom_object/CustomObjectFixtures.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ public class CustomObjectFixtures {
1515
public static void withCustomObject(final Consumer<CustomObject> consumer) {
1616
CustomObject customObject = createCustomObject();
1717
consumer.accept(customObject);
18-
deleteCustomObject(customObject.getId(), customObject.getVersion());
18+
deleteCustomObject(customObject.getContainer(), customObject.getKey(), customObject.getVersion());
1919
}
2020

2121
public static void withUpdateableCustomObject(final UnaryOperator<CustomObject> operator) {
2222
CustomObject customObject = createCustomObject();
2323
customObject = operator.apply(customObject);
24-
deleteCustomObject(customObject.getId(), customObject.getVersion());
24+
deleteCustomObject(customObject.getContainer(), customObject.getKey(), customObject.getVersion());
2525
}
2626

2727
public static CustomObject createCustomObject() {
@@ -41,10 +41,10 @@ public static CustomObject createCustomObject() {
4141
return customObject;
4242
}
4343

44-
public static CustomObject deleteCustomObject(final String id, final Long version) {
44+
public static CustomObject deleteCustomObject(final String container, final String key, final Long version) {
4545
CustomObject customObject = CommercetoolsTestUtils.getProjectRoot()
4646
.customObjects()
47-
.withId(id)
47+
.withContainerAndKey(container, key)
4848
.delete()
4949
.withVersion(version)
5050
.executeBlocking().getBody();

commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/custom_object/CustomObjectIntegrationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ public class CustomObjectIntegrationTests {
1414
@Test
1515
public void createAndDeleteById() {
1616
CustomObject customObject = CustomObjectFixtures.createCustomObject();
17-
CustomObject deletedCustomObject = CustomObjectFixtures.deleteCustomObject(customObject.getId(), customObject.getVersion());
17+
CustomObject deletedCustomObject = CustomObjectFixtures.deleteCustomObject(customObject.getContainer(), customObject.getKey(), customObject.getVersion());
1818

1919
Assert.assertEquals(customObject.getId(), deletedCustomObject.getId());
2020
}
2121

2222
@Test
23-
public void getById() {
23+
public void getByContainerKey() {
2424
CustomObjectFixtures.withCustomObject(customObject -> {
2525
CustomObject queriedCustomObject = CommercetoolsTestUtils.getProjectRoot()
2626
.customObjects()
27-
.withId(customObject.getId())
27+
.withContainerAndKey(customObject.getContainer(), customObject.getKey())
2828
.get()
2929
.executeBlocking().getBody();
3030

0 commit comments

Comments
 (0)