pageElements) {
+ if (pageElements.size() == pageSize) {
+ final String lastElementId = pageElements.get(pageElements.size() - 1).getId();
+ return baseQuery.addWhere("id > :lastId", "lastId", lastElementId).execute();
+ }
+ return completedFuture(null);
+ }
+}
diff --git a/commercetools/commercetools-sdk-java-api/src/main/java/com/commercetools/api/client/QueryUtils.java b/commercetools/commercetools-sdk-java-api/src/main/java/com/commercetools/api/client/QueryUtils.java
new file mode 100644
index 00000000000..27d2ff732be
--- /dev/null
+++ b/commercetools/commercetools-sdk-java-api/src/main/java/com/commercetools/api/client/QueryUtils.java
@@ -0,0 +1,123 @@
+
+package com.commercetools.api.client;
+
+import java.util.List;
+import java.util.concurrent.CompletionStage;
+import java.util.function.Consumer;
+import java.util.function.Function;
+
+import javax.annotation.Nonnull;
+
+import com.commercetools.api.models.DomainResource;
+import com.commercetools.api.models.PagedQueryResourceRequest;
+import com.commercetools.api.models.ResourcePagedQueryResponse;
+
+public class QueryUtils {
+ static int DEFAULT_PAGE_SIZE = 500;
+ /**
+ * Queries all elements matching a query by using a limit based pagination with a combination of
+ * id sorting and a page size 500. More on the algorithm can be found here:
+ * Iterating all elements.
+ *
+ * The method takes a callback {@link java.util.function.Function} that returns a result of type {@code } that
+ * is returned on every page of elements queried. Eventually, the method returns a {@link
+ * java.util.concurrent.CompletionStage} that contains a list of all the results of the callbacks returned from every
+ * page.
+ *
+ *
NOTE: This method fetches all paged results sequentially as opposed to fetching the pages in
+ * parallel.
+ *
+ * @param query query containing predicates and expansion paths
+ * @param pageMapper callback function that is called on every page queried
+ * @param type of one query result element
+ * @param type of the query
+ * @param type of the returned result of the callback function on every page.
+ * @return a completion stage containing a list of mapped pages as a result.
+ */
+ @Nonnull
+ public static , TResult extends ResourcePagedQueryResponse, TElement extends DomainResource, S> CompletionStage> queryAll(
+ @Nonnull final PagedQueryResourceRequest query,
+ @Nonnull final Function, S> pageMapper) {
+ return queryAll(query, pageMapper, DEFAULT_PAGE_SIZE);
+ }
+
+ /**
+ * Queries all elements matching a query by using a limit based pagination with a combination of
+ * id sorting and a page size 500. More on the algorithm can be found here:
+ * Iterating all elements.
+ *
+ * The method takes a consumer {@link Consumer} that is applied on every page of elements
+ * queried.
+ *
+ *
NOTE: This method fetches all paged results sequentially as opposed to fetching the pages in
+ * parallel.
+ *
+ * @param query query containing predicates and expansion paths
+ * @param pageConsumer consumer applied on every page queried
+ * @param type of one query result element
+ * @param type of the query
+ * @return a completion stage containing void as a result after the consumer was applied on all
+ * pages.
+ */
+ @Nonnull
+ public static , TResult extends ResourcePagedQueryResponse, TElement extends DomainResource> CompletionStage queryAll(
+ @Nonnull final PagedQueryResourceRequest query,
+ @Nonnull final Consumer> pageConsumer) {
+ return queryAll(query, pageConsumer, DEFAULT_PAGE_SIZE);
+ }
+
+ /**
+ * Queries all elements matching a query by using a limit based pagination with a combination of
+ * id sorting and the supplied {@code pageSize}. More on the algorithm can be found here:
+ * Iterating all elements.
+ *
+ * The method takes a callback {@link Function} that returns a result of type {@code } that
+ * is returned on every page of elements queried. Eventually, the method returns a {@link
+ * CompletionStage} that contains a list of all the results of the callbacks returned from every
+ * page.
+ *
+ *
NOTE: This method fetches all paged results sequentially as opposed to fetching the pages in
+ * parallel.
+ *
+ * @param query query containing predicates and expansion paths
+ * @param pageMapper callback function that is called on every page queried
+ * @param type of one query result element
+ * @param type of the query
+ * @param type of the returned result of the callback function on every page.
+ * @param pageSize the page size.
+ * @return a completion stage containing a list of mapped pages as a result.
+ */
+ @Nonnull
+ public static , TResult extends ResourcePagedQueryResponse, TElement extends DomainResource, S> CompletionStage> queryAll(
+ @Nonnull final PagedQueryResourceRequest query,
+ @Nonnull final Function, S> pageMapper, final int pageSize) {
+ final QueryAll queryAll = QueryAll.of(query, pageSize);
+ return queryAll.run(pageMapper);
+ }
+
+ /**
+ * Queries all elements matching a query by using a limit based pagination with a combination of
+ * id sorting and the supplied {@code pageSize}. More on the algorithm can be found here:
+ * Iterating all elements.
+ *
+ * The method takes a {@link java.util.function.Consumer} that is applied on every page of the queried elements.
+ *
+ *
NOTE: This method fetches all paged results sequentially as opposed to fetching the pages in
+ * parallel.
+ *
+ * @param query query containing predicates and expansion paths
+ * @param pageConsumer consumer applied on every page queried
+ * @param type of one query result element
+ * @param type of the query
+ * @param pageSize the page size
+ * @return a completion stage containing void as a result after the consumer was applied on all
+ * pages.
+ */
+ @Nonnull
+ public static , TResult extends ResourcePagedQueryResponse, TElement extends DomainResource> CompletionStage queryAll(
+ @Nonnull final PagedQueryResourceRequest query,
+ @Nonnull final Consumer> pageConsumer, final int pageSize) {
+ final QueryAll queryAll = QueryAll.of(query, pageSize);
+ return queryAll.run(pageConsumer);
+ }
+}
diff --git a/commercetools/commercetools-sdk-java-api/src/main/java/com/commercetools/api/models/PagedQueryResourceRequest.java b/commercetools/commercetools-sdk-java-api/src/main/java/com/commercetools/api/models/PagedQueryResourceRequest.java
index b9f81fc46dd..3603f5eacdc 100644
--- a/commercetools/commercetools-sdk-java-api/src/main/java/com/commercetools/api/models/PagedQueryResourceRequest.java
+++ b/commercetools/commercetools-sdk-java-api/src/main/java/com/commercetools/api/models/PagedQueryResourceRequest.java
@@ -4,6 +4,7 @@
import java.util.List;
import java.util.Map;
+import io.vrap.rmf.base.client.ApiMethod;
import io.vrap.rmf.base.client.ClientRequestCommand;
import io.vrap.rmf.base.client.RequestCommand;
@@ -41,6 +42,12 @@ public interface PagedQueryResourceRequest addPredicateVar(final String varName, final List predicateVar);
+ List> getQueryParams();
+
+ List getQueryParam(final String key);
+
+ String getFirstQueryParam(final String key);
+
default PagedQueryResourceRequest asPagedQueryResourceRequest() {
return this;
}
diff --git a/commercetools/internal-docs/src/main/java/com/commercetools/docs/meta/Querying.java b/commercetools/internal-docs/src/main/java/com/commercetools/docs/meta/Querying.java
index 4276d791feb..92ebc814850 100644
--- a/commercetools/internal-docs/src/main/java/com/commercetools/docs/meta/Querying.java
+++ b/commercetools/internal-docs/src/main/java/com/commercetools/docs/meta/Querying.java
@@ -19,6 +19,10 @@
* Get by id/key
*
* {@include.example example.ExamplesTest#getByIdOrKey()}
+ *
+ * Query all
+ *
+ * {@link com.commercetools.api.client.QueryUtils}
*/
public class Querying {
}
From af781c50f132ae540ed0279034a355e7c03d05a3 Mon Sep 17 00:00:00 2001
From: Jens Schulze
Date: Wed, 6 Oct 2021 12:52:38 +0200
Subject: [PATCH 4/5] use projectApiRoot in integration tests
---
.../java/commercetools/ExceptionTest.java | 2 +-
.../api_client/ApiClientFixtures.java | 4 ++--
.../api_client/ApiClientIntegrationTests.java | 4 ++--
.../commercetools/cart/CartsFixtures.java | 4 ++--
.../cart_discount/CartDiscountFixtures.java | 6 ++---
.../CartDiscountIntegrationTests.java | 14 +++++------
.../category/CategoryFixtures.java | 6 ++---
.../category/CategoryIntegrationTests.java | 12 +++++-----
.../channel/ChannelFixtures.java | 4 ++--
.../channel/ChannelIntegrationTests.java | 6 ++---
.../custom_object/CustomObjectFixtures.java | 4 ++--
.../CustomObjectIntegrationTests.java | 8 +++----
.../customer/CustomerFixtures.java | 6 ++---
.../customer/CustomerIntegrationTests.java | 12 +++++-----
.../customer_group/CustomerGroupFixtures.java | 4 ++--
.../CustomerGroupIntegrationTests.java | 12 +++++-----
.../discount_code/DiscountCodeFixtures.java | 4 ++--
.../DiscountCodeIntegrationTests.java | 6 ++---
.../extension/ExtensionFixtures.java | 4 ++--
.../extension/ExtensionIntegrationTests.java | 12 +++++-----
.../inventory/InventoryEntryFixtures.java | 4 ++--
.../inventory/InventoryIntegrationTests.java | 10 ++++----
.../commercetools/me/MyCartsFixtures.java | 2 +-
.../message/MessageIntegrationTests.java | 6 ++---
.../misc/UserAgentHeaderTest.java | 2 +-
...alCustomerPasswordAuthIntegrationTest.java | 2 +-
.../commercetools/order/OrdersFixtures.java | 4 ++--
.../product/ProductFixtures.java | 24 +++++++++----------
.../product/ProductIntegrationTests.java | 13 +++++-----
.../ProductDiscountFixtures.java | 8 +++----
.../ProductDiscountIntegrationTests.java | 14 +++++------
.../ProductProjectionIntegrationTests.java | 10 ++++----
.../product_type/ProductTypeFixtures.java | 4 ++--
.../ProductTypeIntegrationTests.java | 12 +++++-----
.../project/ProjectIntegrationTests.java | 6 ++---
...CategoryErrorHandlingIntegrationTests.java | 8 +++----
.../commercetools/review/ReviewFixtures.java | 6 ++---
.../review/ReviewIntegrationTests.java | 14 +++++------
.../ShippingMethodFixtures.java | 4 ++--
.../ShippingMethodIntegrationTests.java | 12 +++++-----
.../shopping_list/ShoppingListFixtures.java | 4 ++--
.../ShoppingListIntegrationTests.java | 10 ++++----
.../commercetools/state/StateFixtures.java | 4 ++--
.../state/StateIntegrationTests.java | 6 ++---
.../commercetools/store/StoreFixtures.java | 4 ++--
.../store/StoreIntegrationTests.java | 12 +++++-----
.../subscription/SubscriptionFixtures.java | 4 ++--
.../tax_category/TaxCategoryFixtures.java | 4 ++--
.../TaxCategoryIntegrationTests.java | 14 +++++------
.../java/commercetools/type/TypeFixtures.java | 4 ++--
.../type/TypeIntegrationTests.java | 12 +++++-----
.../utils/CommercetoolsTestUtils.java | 12 ----------
.../java/commercetools/zone/ZoneFixtures.java | 4 ++--
.../zone/ZoneIntegrationTests.java | 10 ++++----
54 files changed, 196 insertions(+), 207 deletions(-)
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/ExceptionTest.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/ExceptionTest.java
index c8dfb82b832..6d7de5873f9 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/ExceptionTest.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/ExceptionTest.java
@@ -13,7 +13,7 @@ public class ExceptionTest {
@Test
public void testException() {
Assertions.assertThatExceptionOfType(NotFoundException.class)
- .isThrownBy(() -> CommercetoolsTestUtils.getProjectRoot()
+ .isThrownBy(() -> CommercetoolsTestUtils.getProjectApiRoot()
.categories()
.withKey("unknown-category")
.get()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/api_client/ApiClientFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/api_client/ApiClientFixtures.java
index bec84f09e84..957077e843d 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/api_client/ApiClientFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/api_client/ApiClientFixtures.java
@@ -24,7 +24,7 @@ public static ApiClient createApiClient() {
.scope("manage_project:" + CommercetoolsTestUtils.getProjectKey())
.build();
- ApiClient apiClient = CommercetoolsTestUtils.getProjectRoot()
+ ApiClient apiClient = CommercetoolsTestUtils.getProjectApiRoot()
.apiClients()
.post(apiClientDraft)
.executeBlocking()
@@ -36,7 +36,7 @@ public static ApiClient createApiClient() {
}
public static ApiClient deleteApiClient(final String id) {
- ApiClient apiClient = CommercetoolsTestUtils.getProjectRoot()
+ ApiClient apiClient = CommercetoolsTestUtils.getProjectApiRoot()
.apiClients()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/api_client/ApiClientIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/api_client/ApiClientIntegrationTests.java
index 364948f485a..07f2180f48a 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/api_client/ApiClientIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/api_client/ApiClientIntegrationTests.java
@@ -21,7 +21,7 @@ public void createAndDeleteById() {
@Test
public void getById() {
ApiClientFixtures.withApiClient(apiClient -> {
- ApiClient queriedApiClient = CommercetoolsTestUtils.getProjectRoot()
+ ApiClient queriedApiClient = CommercetoolsTestUtils.getProjectApiRoot()
.apiClients()
.withId(apiClient.getId())
.get()
@@ -36,7 +36,7 @@ public void getById() {
@Test
public void query() {
ApiClientFixtures.withApiClient(apiClient -> {
- ApiClientPagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ ApiClientPagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.apiClients()
.get()
.withWhere("id=" + "\"" + apiClient.getId() + "\"")
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/cart/CartsFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/cart/CartsFixtures.java
index 0bce78c8966..2e23e3a8f35 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/cart/CartsFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/cart/CartsFixtures.java
@@ -14,7 +14,7 @@
public class CartsFixtures {
public static Cart deleteCart(final String id, final Long version) {
- Cart cart = CommercetoolsTestUtils.getProjectRoot()
+ Cart cart = CommercetoolsTestUtils.getProjectApiRoot()
.carts()
.withId(id)
.delete()
@@ -59,7 +59,7 @@ public static void withUpdateableCart(final UnaryOperator operator) {
}
public static Cart createCart(final CartDraft cartDraft) {
- Cart cart = CommercetoolsTestUtils.getProjectRoot().carts().post(cartDraft).executeBlocking().getBody();
+ Cart cart = CommercetoolsTestUtils.getProjectApiRoot().carts().post(cartDraft).executeBlocking().getBody();
Assert.assertNotNull(cart);
Assert.assertEquals(cart.getCountry(), cartDraft.getCountry());
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/cart_discount/CartDiscountFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/cart_discount/CartDiscountFixtures.java
index b5b0c34c8bf..6465228bac6 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/cart_discount/CartDiscountFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/cart_discount/CartDiscountFixtures.java
@@ -31,7 +31,7 @@ public static CartDiscount createCartDiscount() {
.permyriad(10L)
.build();
- List cartDiscounts = CommercetoolsTestUtils.getProjectRoot()
+ List cartDiscounts = CommercetoolsTestUtils.getProjectApiRoot()
.cartDiscounts()
.get()
.withWhere("sortOrder=\"0.41\"")
@@ -58,7 +58,7 @@ public static CartDiscount createCartDiscount() {
.stackingMode(StackingMode.STACKING)
.build();
- CartDiscount cartDiscount = CommercetoolsTestUtils.getProjectRoot()
+ CartDiscount cartDiscount = CommercetoolsTestUtils.getProjectApiRoot()
.cartDiscounts()
.post(cartDiscountDraft)
.executeBlocking()
@@ -71,7 +71,7 @@ public static CartDiscount createCartDiscount() {
}
public static CartDiscount deleteCartDiscount(final String id, final Long version) {
- CartDiscount deletedCartDiscount = CommercetoolsTestUtils.getProjectRoot()
+ CartDiscount deletedCartDiscount = CommercetoolsTestUtils.getProjectApiRoot()
.cartDiscounts()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/cart_discount/CartDiscountIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/cart_discount/CartDiscountIntegrationTests.java
index 756c0a0a1c3..453bfcda24d 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/cart_discount/CartDiscountIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/cart_discount/CartDiscountIntegrationTests.java
@@ -35,7 +35,7 @@ public void createAndDelete() {
.sortOrder("0.42")
.build();
- CartDiscount cartDiscount = CommercetoolsTestUtils.getProjectRoot()
+ CartDiscount cartDiscount = CommercetoolsTestUtils.getProjectApiRoot()
.cartDiscounts()
.post(cartDiscountDraft)
.executeBlocking()
@@ -44,7 +44,7 @@ public void createAndDelete() {
Assert.assertNotNull(cartDiscount);
Assert.assertEquals(cartDiscountDraft.getKey(), cartDiscount.getKey());
- CartDiscount deletedCartDiscount = CommercetoolsTestUtils.getProjectRoot()
+ CartDiscount deletedCartDiscount = CommercetoolsTestUtils.getProjectApiRoot()
.cartDiscounts()
.withId(cartDiscount.getId())
.delete()
@@ -58,7 +58,7 @@ public void createAndDelete() {
@Test
public void getById() {
CartDiscountFixtures.withCartDiscount(cartDiscount -> {
- CartDiscount queriedCartDiscount = CommercetoolsTestUtils.getProjectRoot()
+ CartDiscount queriedCartDiscount = CommercetoolsTestUtils.getProjectApiRoot()
.cartDiscounts()
.withId(cartDiscount.getId())
.get()
@@ -73,7 +73,7 @@ public void getById() {
@Test
public void getByKey() {
CartDiscountFixtures.withCartDiscount(cartDiscount -> {
- CartDiscount queriedCartDiscount = CommercetoolsTestUtils.getProjectRoot()
+ CartDiscount queriedCartDiscount = CommercetoolsTestUtils.getProjectApiRoot()
.cartDiscounts()
.withKey(cartDiscount.getKey())
.get()
@@ -88,7 +88,7 @@ public void getByKey() {
@Test
public void query() {
CartDiscountFixtures.withCartDiscount(cartDiscount -> {
- CartDiscountPagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ CartDiscountPagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.cartDiscounts()
.get()
.withWhere("id=" + "\"" + cartDiscount.getId() + "\"")
@@ -106,7 +106,7 @@ public void updateById() {
List updateActions = new ArrayList<>();
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(CartDiscountSetKeyActionBuilder.of().key(newKey).build());
- CartDiscount updatedCartDiscount = CommercetoolsTestUtils.getProjectRoot()
+ CartDiscount updatedCartDiscount = CommercetoolsTestUtils.getProjectApiRoot()
.cartDiscounts()
.withId(cartDiscount.getId())
.post(CartDiscountUpdateBuilder.of()
@@ -129,7 +129,7 @@ public void updateByKey() {
List updateActions = new ArrayList<>();
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(CartDiscountSetKeyActionBuilder.of().key(newKey).build());
- CartDiscount updatedCartDiscount = CommercetoolsTestUtils.getProjectRoot()
+ CartDiscount updatedCartDiscount = CommercetoolsTestUtils.getProjectApiRoot()
.cartDiscounts()
.withKey(cartDiscount.getKey())
.post(CartDiscountUpdateBuilder.of()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/category/CategoryFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/category/CategoryFixtures.java
index 768a7d0109c..f1748b80e00 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/category/CategoryFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/category/CategoryFixtures.java
@@ -50,7 +50,7 @@ public static Category createCategory() {
.build()))
.build();
- Type type = CommercetoolsTestUtils.getProjectRoot().types().post(typeDraft).executeBlocking().getBody();
+ Type type = CommercetoolsTestUtils.getProjectApiRoot().types().post(typeDraft).executeBlocking().getBody();
CategoryDraft categoryDraft = CategoryDraftBuilder.of()
.key(CommercetoolsTestUtils.randomKey())
@@ -72,12 +72,12 @@ public static Category createCategory() {
.build()))
.build();
- return CommercetoolsTestUtils.getProjectRoot().categories().post(categoryDraft).executeBlocking().getBody();
+ return CommercetoolsTestUtils.getProjectApiRoot().categories().post(categoryDraft).executeBlocking().getBody();
}
public static Category deleteCategory(final String id, final Long version) {
- return CommercetoolsTestUtils.getProjectRoot()
+ return CommercetoolsTestUtils.getProjectApiRoot()
.categories()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/category/CategoryIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/category/CategoryIntegrationTests.java
index 7eff2ea8a1a..80fab02ca99 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/category/CategoryIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/category/CategoryIntegrationTests.java
@@ -21,7 +21,7 @@ public void createAndDelete() {
@Test
public void getById() {
CategoryFixtures.withCategory(category -> {
- Category queriedCategory = CommercetoolsTestUtils.getProjectRoot()
+ Category queriedCategory = CommercetoolsTestUtils.getProjectApiRoot()
.categories()
.withId(category.getId())
.get()
@@ -34,7 +34,7 @@ public void getById() {
@Test
public void getByKey() {
CategoryFixtures.withCategory(category -> {
- Category queriedCategory = CommercetoolsTestUtils.getProjectRoot()
+ Category queriedCategory = CommercetoolsTestUtils.getProjectApiRoot()
.categories()
.withKey(category.getKey())
.get()
@@ -48,7 +48,7 @@ public void getByKey() {
@Test
public void deleteById() {
Category category = CategoryFixtures.createCategory();
- Category deletedCategory = CommercetoolsTestUtils.getProjectRoot()
+ Category deletedCategory = CommercetoolsTestUtils.getProjectApiRoot()
.categories()
.withId(category.getId())
.delete()
@@ -61,7 +61,7 @@ public void deleteById() {
@Test
public void deleteByKey() {
Category category = CategoryFixtures.createCategory();
- Category deletedCategory = CommercetoolsTestUtils.getProjectRoot()
+ Category deletedCategory = CommercetoolsTestUtils.getProjectApiRoot()
.categories()
.withKey(category.getKey())
.delete()
@@ -74,7 +74,7 @@ public void deleteByKey() {
@Test
public void queryCategories() {
Category category = CategoryFixtures.createCategory();
- CategoryPagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ CategoryPagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.categories()
.get()
.withWhere("id=" + "\"" + category.getId() + "\"")
@@ -95,7 +95,7 @@ public void updateCategory() {
.version(category.getVersion())
.actions(CategoryChangeNameActionBuilder.of().name(newName).build())
.build();
- Category updatedCategory = CommercetoolsTestUtils.getProjectRoot()
+ Category updatedCategory = CommercetoolsTestUtils.getProjectApiRoot()
.categories()
.withId(category.getId())
.post(categoryUpdate)
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/channel/ChannelFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/channel/ChannelFixtures.java
index 175e88167f4..d68a0b12c81 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/channel/ChannelFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/channel/ChannelFixtures.java
@@ -35,7 +35,7 @@ public static Channel createChannel() {
.geoLocation(GeoJsonPointBuilder.of().coordinates(Arrays.asList(13.0, 51.0)).build())
.build();
- Channel channel = CommercetoolsTestUtils.getProjectRoot()
+ Channel channel = CommercetoolsTestUtils.getProjectApiRoot()
.channels()
.post(channelDraft)
.executeBlocking()
@@ -48,7 +48,7 @@ public static Channel createChannel() {
}
public static Channel deleteChannel(final String id, final Long version) {
- Channel channel = CommercetoolsTestUtils.getProjectRoot()
+ Channel channel = CommercetoolsTestUtils.getProjectApiRoot()
.channels()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/channel/ChannelIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/channel/ChannelIntegrationTests.java
index a91c2d8f22f..69ce93ef30d 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/channel/ChannelIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/channel/ChannelIntegrationTests.java
@@ -23,7 +23,7 @@ public void createAndDeleteById() {
@Test
public void getById() {
ChannelFixtures.withChannel(channel -> {
- Channel queriedChannel = CommercetoolsTestUtils.getProjectRoot()
+ Channel queriedChannel = CommercetoolsTestUtils.getProjectApiRoot()
.channels()
.withId(channel.getId())
.get()
@@ -38,7 +38,7 @@ public void getById() {
@Test
public void query() {
ChannelFixtures.withChannel(channel -> {
- ChannelPagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ ChannelPagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.channels()
.get()
.withWhere("id=" + "\"" + channel.getId() + "\"")
@@ -56,7 +56,7 @@ public void update() {
List updateActions = new ArrayList<>();
updateActions.add(ChannelSetGeoLocationActionBuilder.of().build());
- Channel updateChannel = CommercetoolsTestUtils.getProjectRoot()
+ Channel updateChannel = CommercetoolsTestUtils.getProjectApiRoot()
.channels()
.withId(channel.getId())
.post(ChannelUpdateBuilder.of().actions(updateActions).version(channel.getVersion()).build())
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/custom_object/CustomObjectFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/custom_object/CustomObjectFixtures.java
index edbfb068536..8f248044c29 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/custom_object/CustomObjectFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/custom_object/CustomObjectFixtures.java
@@ -33,7 +33,7 @@ public static CustomObject createCustomObject() {
.value((ValueObject) () -> "val")
.build();
- CustomObject customObject = CommercetoolsTestUtils.getProjectRoot()
+ CustomObject customObject = CommercetoolsTestUtils.getProjectApiRoot()
.customObjects()
.post(customObjectDraft)
.executeBlocking()
@@ -45,7 +45,7 @@ public static CustomObject createCustomObject() {
}
public static CustomObject deleteCustomObject(final String container, final String key, final Long version) {
- CustomObject customObject = CommercetoolsTestUtils.getProjectRoot()
+ CustomObject customObject = CommercetoolsTestUtils.getProjectApiRoot()
.customObjects()
.withContainerAndKey(container, key)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/custom_object/CustomObjectIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/custom_object/CustomObjectIntegrationTests.java
index b392cadd628..fd2a8c24843 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/custom_object/CustomObjectIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/custom_object/CustomObjectIntegrationTests.java
@@ -29,7 +29,7 @@ public void createAndDeleteById() {
@Test
public void getByContainerKey() {
CustomObjectFixtures.withCustomObject(customObject -> {
- CustomObject queriedCustomObject = CommercetoolsTestUtils.getProjectRoot()
+ CustomObject queriedCustomObject = CommercetoolsTestUtils.getProjectApiRoot()
.customObjects()
.withContainerAndKey(customObject.getContainer(), customObject.getKey())
.get()
@@ -50,7 +50,7 @@ public void update() {
.value((ValueObject) () -> "foo")
.build();
- CustomObject updatedCustomObject = CommercetoolsTestUtils.getProjectRoot()
+ CustomObject updatedCustomObject = CommercetoolsTestUtils.getProjectApiRoot()
.customObjects()
.post(customObjectDraft)
.executeBlocking()
@@ -72,7 +72,7 @@ public void updateWithJsonNode() {
.value(JsonUtils.getConfiguredObjectMapper().createObjectNode().put("value", "foo"))
.build();
- CustomObject updatedCustomObject = CommercetoolsTestUtils.getProjectRoot()
+ CustomObject updatedCustomObject = CommercetoolsTestUtils.getProjectApiRoot()
.customObjects()
.post(customObjectDraft)
.executeBlocking()
@@ -88,7 +88,7 @@ public void updateWithJsonNode() {
@Test
public void query() {
CustomObjectFixtures.withCustomObject(customObject -> {
- CustomObjectPagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ CustomObjectPagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.customObjects()
.get()
.withWhere("id=" + "\"" + customObject.getId() + "\"")
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/customer/CustomerFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/customer/CustomerFixtures.java
index bbcff818802..93ad47e5317 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/customer/CustomerFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/customer/CustomerFixtures.java
@@ -45,7 +45,7 @@ public static Customer createCustomer() {
.addresses(Arrays.asList(AddressBuilder.of().country("DE").build()))
.build();
- Customer customer = CommercetoolsTestUtils.getProjectRoot()
+ Customer customer = CommercetoolsTestUtils.getProjectApiRoot()
.customers()
.post(customerDraft)
.executeBlocking()
@@ -71,7 +71,7 @@ public static Customer createStoreCustomer() {
.addresses(Arrays.asList(AddressBuilder.of().country("DE").build()))
.build();
- Customer customer = CommercetoolsTestUtils.getProjectRoot()
+ Customer customer = CommercetoolsTestUtils.getProjectApiRoot()
.customers()
.post(customerDraft)
.executeBlocking()
@@ -85,7 +85,7 @@ public static Customer createStoreCustomer() {
}
public static Customer deleteCustomer(final String id, final Long version) {
- Customer customer = CommercetoolsTestUtils.getProjectRoot()
+ Customer customer = CommercetoolsTestUtils.getProjectApiRoot()
.customers()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/customer/CustomerIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/customer/CustomerIntegrationTests.java
index 9ff5be826d4..3d5477b8ff7 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/customer/CustomerIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/customer/CustomerIntegrationTests.java
@@ -22,7 +22,7 @@ public void createAndDeleteById() {
@Test
public void getById() {
CustomerFixtures.withCustomer(customer -> {
- Customer queriedCustomer = CommercetoolsTestUtils.getProjectRoot()
+ Customer queriedCustomer = CommercetoolsTestUtils.getProjectApiRoot()
.customers()
.withId(customer.getId())
.get()
@@ -37,7 +37,7 @@ public void getById() {
@Test
public void getByKey() {
CustomerFixtures.withCustomer(customer -> {
- Customer queriedCustomer = CommercetoolsTestUtils.getProjectRoot()
+ Customer queriedCustomer = CommercetoolsTestUtils.getProjectApiRoot()
.customers()
.withKey(customer.getKey())
.get()
@@ -52,7 +52,7 @@ public void getByKey() {
@Test
public void query() {
CustomerFixtures.withCustomer(customer -> {
- CustomerPagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ CustomerPagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.customers()
.get()
.withWhere("id=" + "\"" + customer.getId() + "\"")
@@ -71,7 +71,7 @@ public void updateById() {
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(CustomerSetKeyActionBuilder.of().key(newKey).build());
- Customer updatedCustomer = CommercetoolsTestUtils.getProjectRoot()
+ Customer updatedCustomer = CommercetoolsTestUtils.getProjectApiRoot()
.customers()
.withId(customer.getId())
.post(CustomerUpdateBuilder.of().actions(updateActions).version(customer.getVersion()).build())
@@ -92,7 +92,7 @@ public void updateByKey() {
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(CustomerSetKeyActionBuilder.of().key(newKey).build());
- Customer updatedCustomer = CommercetoolsTestUtils.getProjectRoot()
+ Customer updatedCustomer = CommercetoolsTestUtils.getProjectApiRoot()
.customers()
.withKey(customer.getKey())
.post(CustomerUpdateBuilder.of().actions(updateActions).version(customer.getVersion()).build())
@@ -109,7 +109,7 @@ public void updateByKey() {
@Test
public void deleteByKey() {
Customer customer = CustomerFixtures.createCustomer();
- Customer deletedCustomer = CommercetoolsTestUtils.getProjectRoot()
+ Customer deletedCustomer = CommercetoolsTestUtils.getProjectApiRoot()
.customers()
.withKey(customer.getKey())
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/customer_group/CustomerGroupFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/customer_group/CustomerGroupFixtures.java
index 0dd5ae89194..581876dc525 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/customer_group/CustomerGroupFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/customer_group/CustomerGroupFixtures.java
@@ -31,7 +31,7 @@ public static CustomerGroup createCustomerGroup() {
.groupName(CommercetoolsTestUtils.randomString())
.build();
- CustomerGroup customerGroup = CommercetoolsTestUtils.getProjectRoot()
+ CustomerGroup customerGroup = CommercetoolsTestUtils.getProjectApiRoot()
.customerGroups()
.post(customerGroupDraft)
.executeBlocking()
@@ -44,7 +44,7 @@ public static CustomerGroup createCustomerGroup() {
}
public static CustomerGroup deleteCustomerGroup(final String id, final Long version) {
- CustomerGroup customerGroup = CommercetoolsTestUtils.getProjectRoot()
+ CustomerGroup customerGroup = CommercetoolsTestUtils.getProjectApiRoot()
.customerGroups()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/customer_group/CustomerGroupIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/customer_group/CustomerGroupIntegrationTests.java
index 73083292628..d0e2e18d0d6 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/customer_group/CustomerGroupIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/customer_group/CustomerGroupIntegrationTests.java
@@ -26,7 +26,7 @@ public void createAndDeleteById() {
@Test
public void getById() {
CustomerGroupFixtures.withCustomerGroup(customerGroup -> {
- CustomerGroup queriedCustomerGroup = CommercetoolsTestUtils.getProjectRoot()
+ CustomerGroup queriedCustomerGroup = CommercetoolsTestUtils.getProjectApiRoot()
.customerGroups()
.withId(customerGroup.getId())
.get()
@@ -41,7 +41,7 @@ public void getById() {
@Test
public void getByKey() {
CustomerGroupFixtures.withCustomerGroup(customerGroup -> {
- CustomerGroup queriedCustomerGroup = CommercetoolsTestUtils.getProjectRoot()
+ CustomerGroup queriedCustomerGroup = CommercetoolsTestUtils.getProjectApiRoot()
.customerGroups()
.withKey(customerGroup.getKey())
.get()
@@ -56,7 +56,7 @@ public void getByKey() {
@Test
public void query() {
CustomerGroupFixtures.withCustomerGroup(customerGroup -> {
- CustomerGroupPagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ CustomerGroupPagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.customerGroups()
.get()
.withWhere("id=" + "\"" + customerGroup.getId() + "\"")
@@ -74,7 +74,7 @@ public void updateById() {
List updateActions = new ArrayList<>();
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(CustomerGroupSetKeyActionBuilder.of().key(newKey).build());
- CustomerGroup updatedCustomerGroup = CommercetoolsTestUtils.getProjectRoot()
+ CustomerGroup updatedCustomerGroup = CommercetoolsTestUtils.getProjectApiRoot()
.customerGroups()
.withId(customerGroup.getId())
.post(CustomerGroupUpdateBuilder.of()
@@ -97,7 +97,7 @@ public void updateByKey() {
List updateActions = new ArrayList<>();
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(CustomerGroupSetKeyActionBuilder.of().key(newKey).build());
- CustomerGroup updatedCustomerGroup = CommercetoolsTestUtils.getProjectRoot()
+ CustomerGroup updatedCustomerGroup = CommercetoolsTestUtils.getProjectApiRoot()
.customerGroups()
.withKey(customerGroup.getKey())
.post(CustomerGroupUpdateBuilder.of()
@@ -117,7 +117,7 @@ public void updateByKey() {
@Test
public void deleteByKey() {
CustomerGroup customerGroup = CustomerGroupFixtures.createCustomerGroup();
- CustomerGroup deletedCustomerGroup = CommercetoolsTestUtils.getProjectRoot()
+ CustomerGroup deletedCustomerGroup = CommercetoolsTestUtils.getProjectApiRoot()
.customerGroups()
.withId(customerGroup.getId())
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/discount_code/DiscountCodeFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/discount_code/DiscountCodeFixtures.java
index dafb75f834a..73d0995d1c1 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/discount_code/DiscountCodeFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/discount_code/DiscountCodeFixtures.java
@@ -52,7 +52,7 @@ public static DiscountCode createDiscountCode() {
.maxApplicationsPerCustomer(1L)
.build();
- DiscountCode discountCode = CommercetoolsTestUtils.getProjectRoot()
+ DiscountCode discountCode = CommercetoolsTestUtils.getProjectApiRoot()
.discountCodes()
.post(discountCodeDraft)
.executeBlocking()
@@ -65,7 +65,7 @@ public static DiscountCode createDiscountCode() {
}
public static DiscountCode deleteDiscountCode(final String id, final Long version) {
- DiscountCode discountCode = CommercetoolsTestUtils.getProjectRoot()
+ DiscountCode discountCode = CommercetoolsTestUtils.getProjectApiRoot()
.discountCodes()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/discount_code/DiscountCodeIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/discount_code/DiscountCodeIntegrationTests.java
index 33ac54f1c03..2737ba18744 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/discount_code/DiscountCodeIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/discount_code/DiscountCodeIntegrationTests.java
@@ -21,7 +21,7 @@ public void createAndDelete() {
@Test
public void getById() {
DiscountCodeFixtures.withDiscountCode(discountCode -> {
- DiscountCode queriedDiscountCode = CommercetoolsTestUtils.getProjectRoot()
+ DiscountCode queriedDiscountCode = CommercetoolsTestUtils.getProjectApiRoot()
.discountCodes()
.withId(discountCode.getId())
.get()
@@ -36,7 +36,7 @@ public void getById() {
@Test
public void query() {
DiscountCodeFixtures.withDiscountCode(discountCode -> {
- DiscountCodePagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ DiscountCodePagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.discountCodes()
.get()
.withWhere("id=" + "\"" + discountCode.getId() + "\"")
@@ -53,7 +53,7 @@ public void updateById() {
DiscountCodeFixtures.withUpdateableDiscountCode(discountCode -> {
List updateActions = new ArrayList<>();
updateActions.add(DiscountCodeSetMaxApplicationsActionBuilder.of().maxApplications(10L).build());
- DiscountCode updatedDiscountCode = CommercetoolsTestUtils.getProjectRoot()
+ DiscountCode updatedDiscountCode = CommercetoolsTestUtils.getProjectApiRoot()
.discountCodes()
.withId(discountCode.getId())
.post(DiscountCodeUpdateBuilder.of()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/extension/ExtensionFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/extension/ExtensionFixtures.java
index 2957db359c1..db5eb1e2649 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/extension/ExtensionFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/extension/ExtensionFixtures.java
@@ -34,7 +34,7 @@ public static Extension createExtension() {
.build()))
.build();
- Extension extension = CommercetoolsTestUtils.getProjectRoot()
+ Extension extension = CommercetoolsTestUtils.getProjectApiRoot()
.extensions()
.post(extensionDraft)
.executeBlocking()
@@ -47,7 +47,7 @@ public static Extension createExtension() {
}
public static Extension deleteExtension(final String id, final Long version) {
- Extension extension = CommercetoolsTestUtils.getProjectRoot()
+ Extension extension = CommercetoolsTestUtils.getProjectApiRoot()
.extensions()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/extension/ExtensionIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/extension/ExtensionIntegrationTests.java
index fae9c699aaf..347518b79bd 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/extension/ExtensionIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/extension/ExtensionIntegrationTests.java
@@ -23,7 +23,7 @@ public void createAndDeleteById() {
@Test
public void getById() {
ExtensionFixtures.withExtension(extension -> {
- Extension queriedExtension = CommercetoolsTestUtils.getProjectRoot()
+ Extension queriedExtension = CommercetoolsTestUtils.getProjectApiRoot()
.extensions()
.withId(extension.getId())
.get()
@@ -38,7 +38,7 @@ public void getById() {
@Test
public void getByKey() {
ExtensionFixtures.withExtension(extension -> {
- Extension queriedExtension = CommercetoolsTestUtils.getProjectRoot()
+ Extension queriedExtension = CommercetoolsTestUtils.getProjectApiRoot()
.extensions()
.withKey(extension.getKey())
.get()
@@ -53,7 +53,7 @@ public void getByKey() {
@Test
public void query() {
ExtensionFixtures.withExtension(extension -> {
- ExtensionPagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ ExtensionPagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.extensions()
.get()
.withWhere("id=" + "\"" + extension.getId() + "\"")
@@ -71,7 +71,7 @@ public void updateById() {
List updateActions = new ArrayList<>();
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(ExtensionSetKeyActionBuilder.of().key(newKey).build());
- Extension updatedExtension = CommercetoolsTestUtils.getProjectRoot()
+ Extension updatedExtension = CommercetoolsTestUtils.getProjectApiRoot()
.extensions()
.withId(extension.getId())
.post(ExtensionUpdateBuilder.of().actions(updateActions).version(extension.getVersion()).build())
@@ -91,7 +91,7 @@ public void updateByKey() {
List updateActions = new ArrayList<>();
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(ExtensionSetKeyActionBuilder.of().key(newKey).build());
- Extension updatedExtension = CommercetoolsTestUtils.getProjectRoot()
+ Extension updatedExtension = CommercetoolsTestUtils.getProjectApiRoot()
.extensions()
.withKey(extension.getKey())
.post(ExtensionUpdateBuilder.of().actions(updateActions).version(extension.getVersion()).build())
@@ -108,7 +108,7 @@ public void updateByKey() {
@Test
public void deleteByKey() {
Extension extension = ExtensionFixtures.createExtension();
- Extension deletedExtension = CommercetoolsTestUtils.getProjectRoot()
+ Extension deletedExtension = CommercetoolsTestUtils.getProjectApiRoot()
.extensions()
.withId(extension.getId())
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/inventory/InventoryEntryFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/inventory/InventoryEntryFixtures.java
index d4fc9a2488c..93515577333 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/inventory/InventoryEntryFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/inventory/InventoryEntryFixtures.java
@@ -40,7 +40,7 @@ public static InventoryEntry create() {
.supplyChannel(ChannelResourceIdentifierBuilder.of().id(channel.getId()).build())
.build();
- InventoryEntry inventoryEntry = CommercetoolsTestUtils.getProjectRoot()
+ InventoryEntry inventoryEntry = CommercetoolsTestUtils.getProjectApiRoot()
.inventory()
.post(inventoryEntryDraft)
.executeBlocking()
@@ -54,7 +54,7 @@ public static InventoryEntry create() {
}
public static InventoryEntry delete(final String id) {
- InventoryEntry inventoryEntry = CommercetoolsTestUtils.getProjectRoot()
+ InventoryEntry inventoryEntry = CommercetoolsTestUtils.getProjectApiRoot()
.inventory()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/inventory/InventoryIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/inventory/InventoryIntegrationTests.java
index c4e1be1250e..720773c2bad 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/inventory/InventoryIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/inventory/InventoryIntegrationTests.java
@@ -19,7 +19,7 @@ public void createAndDelete() {
.quantityOnStock(10L)
.build();
- InventoryEntry inventoryEntry = CommercetoolsTestUtils.getProjectRoot()
+ InventoryEntry inventoryEntry = CommercetoolsTestUtils.getProjectApiRoot()
.inventory()
.post(inventoryEntryDraft)
.executeBlocking()
@@ -29,7 +29,7 @@ public void createAndDelete() {
Assert.assertEquals(inventoryEntry.getSku(), inventoryEntryDraft.getSku());
Assert.assertEquals(inventoryEntry.getQuantityOnStock(), inventoryEntryDraft.getQuantityOnStock());
- InventoryEntry deletedInventoryEntry = CommercetoolsTestUtils.getProjectRoot()
+ InventoryEntry deletedInventoryEntry = CommercetoolsTestUtils.getProjectApiRoot()
.inventory()
.withId(inventoryEntry.getId())
.delete()
@@ -43,7 +43,7 @@ public void createAndDelete() {
@Test
public void getById() {
InventoryEntryFixtures.withInventoryEntry(inventoryEntry -> {
- InventoryEntry queriedInventoryEntry = CommercetoolsTestUtils.getProjectRoot()
+ InventoryEntry queriedInventoryEntry = CommercetoolsTestUtils.getProjectApiRoot()
.inventory()
.withId(inventoryEntry.getId())
.get()
@@ -57,7 +57,7 @@ public void getById() {
@Test
public void query() {
InventoryEntryFixtures.withInventoryEntry(inventoryEntry -> {
- InventoryPagedQueryResponse inventoryPagedQueryResponse = CommercetoolsTestUtils.getProjectRoot()
+ InventoryPagedQueryResponse inventoryPagedQueryResponse = CommercetoolsTestUtils.getProjectApiRoot()
.inventory()
.get()
.withWhere("id=" + "\"" + inventoryEntry.getId() + "\"")
@@ -74,7 +74,7 @@ public void update() {
List updateActions = new ArrayList<>();
updateActions.add(InventoryEntrySetRestockableInDaysActionBuilder.of().restockableInDays(10L).build());
- InventoryEntry updatedInventoryEntry = CommercetoolsTestUtils.getProjectRoot()
+ InventoryEntry updatedInventoryEntry = CommercetoolsTestUtils.getProjectApiRoot()
.inventory()
.withId(inventoryEntry.getId())
.post(InventoryEntryUpdateBuilder.of()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/me/MyCartsFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/me/MyCartsFixtures.java
index 9e9bfa6cee7..e69d28ca3bd 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/me/MyCartsFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/me/MyCartsFixtures.java
@@ -31,7 +31,7 @@ public static void withUpdateableMeCart(final UnaryOperator operator) {
}
public static Cart createMeCart(final MyCartDraft myCartDraft) {
- Cart myCart = CommercetoolsTestUtils.getProjectRoot()
+ Cart myCart = CommercetoolsTestUtils.getProjectApiRoot()
.me()
.carts()
.post(myCartDraft)
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/message/MessageIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/message/MessageIntegrationTests.java
index d0ab7ebc7fd..257fc579b3d 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/message/MessageIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/message/MessageIntegrationTests.java
@@ -17,7 +17,7 @@ public void query() {
Product product = ProductFixtures.createProduct();
ProductFixtures.deleteProductById(product.getId(), product.getVersion());
- MessagePagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ MessagePagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.messages()
.get()
.executeBlocking()
@@ -32,14 +32,14 @@ public void getById() {
Product product = ProductFixtures.createProduct();
ProductFixtures.deleteProductById(product.getId(), product.getVersion());
- MessagePagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ MessagePagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.messages()
.get()
.executeBlocking()
.getBody();
String messageId = response.getResults().get(0).getId();
- Message message = CommercetoolsTestUtils.getProjectRoot()
+ Message message = CommercetoolsTestUtils.getProjectApiRoot()
.messages()
.withId(messageId)
.get()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/misc/UserAgentHeaderTest.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/misc/UserAgentHeaderTest.java
index b58821f609a..74293d18503 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/misc/UserAgentHeaderTest.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/misc/UserAgentHeaderTest.java
@@ -15,7 +15,7 @@ public class UserAgentHeaderTest {
@Ignore
@Test
public void execute() {
- ByProjectKeyCategoriesGet request = CommercetoolsTestUtils.getProjectRoot().categories().get();
+ ByProjectKeyCategoriesGet request = CommercetoolsTestUtils.getProjectApiRoot().categories().get();
VrapHttpClient vrapHttpClient = HttpClientSupplier.of().get();
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/oauth/GlobalCustomerPasswordAuthIntegrationTest.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/oauth/GlobalCustomerPasswordAuthIntegrationTest.java
index 69262c3dde0..6a32247b7ad 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/oauth/GlobalCustomerPasswordAuthIntegrationTest.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/oauth/GlobalCustomerPasswordAuthIntegrationTest.java
@@ -32,7 +32,7 @@ public void execute() {
.password(password)
.build();
- Customer customer = CommercetoolsTestUtils.getProjectRoot()
+ Customer customer = CommercetoolsTestUtils.getProjectApiRoot()
.customers()
.post(customerDraft)
.executeBlocking()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/order/OrdersFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/order/OrdersFixtures.java
index 3df17cc2aee..95e20e8c0e6 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/order/OrdersFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/order/OrdersFixtures.java
@@ -9,7 +9,7 @@
public class OrdersFixtures {
public static Order deleteOrder(final String id, final Long version) {
- Order order = CommercetoolsTestUtils.getProjectRoot()
+ Order order = CommercetoolsTestUtils.getProjectApiRoot()
.orders()
.withId(id)
.delete()
@@ -24,7 +24,7 @@ public static Order deleteOrder(final String id, final Long version) {
}
public static OrderEdit deleteOrderEdit(final String id, final Long version) {
- OrderEdit orderEdit = CommercetoolsTestUtils.getProjectRoot()
+ OrderEdit orderEdit = CommercetoolsTestUtils.getProjectApiRoot()
.orders()
.edits()
.withId(id)
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product/ProductFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product/ProductFixtures.java
index 1f936fb2e85..b277318eda0 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product/ProductFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product/ProductFixtures.java
@@ -105,7 +105,7 @@ public static Product createProduct() {
.build())
.build();
- ProductType productType = CommercetoolsTestUtils.getProjectRoot()
+ ProductType productType = CommercetoolsTestUtils.getProjectApiRoot()
.productTypes()
.post(productTypeDraft)
.executeBlocking()
@@ -119,7 +119,7 @@ public static Product createProduct() {
CustomerGroup customerGroup = CustomerGroupFixtures.createCustomerGroup();
Channel channel = ChannelFixtures.createChannel();
- ProductDiscountPagedQueryResponse existing = CommercetoolsTestUtils.getProjectRoot()
+ ProductDiscountPagedQueryResponse existing = CommercetoolsTestUtils.getProjectApiRoot()
.productDiscounts()
.get()
.withWhere("sortOrder=\"0.3\"")
@@ -129,7 +129,7 @@ public static Product createProduct() {
if (existing.getCount() != 0) {
String productDiscountId = existing.getResults().get(0).getId();
Long productDiscountVersion = existing.getResults().get(0).getVersion();
- CommercetoolsTestUtils.getProjectRoot()
+ CommercetoolsTestUtils.getProjectApiRoot()
.productDiscounts()
.withId(productDiscountId)
.delete()
@@ -146,7 +146,7 @@ public static Product createProduct() {
.isActive(true)
.build();
- ProductDiscount productDiscount = CommercetoolsTestUtils.getProjectRoot()
+ ProductDiscount productDiscount = CommercetoolsTestUtils.getProjectApiRoot()
.productDiscounts()
.post(productDiscountDraft)
.executeBlocking()
@@ -204,7 +204,7 @@ public static Product createProduct() {
.key(CommercetoolsTestUtils.randomKey())
.build();
- State state = CommercetoolsTestUtils.getProjectRoot().states().post(stateDraft).executeBlocking().getBody();
+ State state = CommercetoolsTestUtils.getProjectApiRoot().states().post(stateDraft).executeBlocking().getBody();
ProductDraft productDraft = ProductDraftBuilder.of()
.key(randomKey)
@@ -223,7 +223,7 @@ public static Product createProduct() {
.publish(false)
.build();
- Product product = CommercetoolsTestUtils.getProjectRoot()
+ Product product = CommercetoolsTestUtils.getProjectApiRoot()
.products()
.post(productDraft)
.executeBlocking()
@@ -239,7 +239,7 @@ public static Product deleteProduct(Product product) {
try {
rProduct = CompletableFuture.completedFuture(product).thenComposeAsync(product1 -> {
if (product1.getMasterData().getPublished()) {
- return CommercetoolsTestUtils.getProjectRoot()
+ return CommercetoolsTestUtils.getProjectApiRoot()
.products()
.withId(product1.getId())
.post(ProductUpdateBuilder.of()
@@ -251,7 +251,7 @@ public static Product deleteProduct(Product product) {
}
return CompletableFuture.completedFuture(product1);
})
- .thenComposeAsync(product1 -> CommercetoolsTestUtils.getProjectRoot()
+ .thenComposeAsync(product1 -> CommercetoolsTestUtils.getProjectApiRoot()
.products()
.withId(product1.getId())
.delete()
@@ -271,7 +271,7 @@ public static Product deleteProduct(Product product) {
public static Product deleteProductById(final String id, final Long version) {
Product product = null;
try {
- product = CommercetoolsTestUtils.getProjectRoot()
+ product = CommercetoolsTestUtils.getProjectApiRoot()
.products()
.withId(id)
.get()
@@ -279,7 +279,7 @@ public static Product deleteProductById(final String id, final Long version) {
.thenComposeAsync(productApiHttpResponse -> {
Product product1 = productApiHttpResponse.getBody();
if (product1.getMasterData().getPublished()) {
- return CommercetoolsTestUtils.getProjectRoot()
+ return CommercetoolsTestUtils.getProjectApiRoot()
.products()
.withId(product1.getId())
.post(ProductUpdateBuilder.of()
@@ -290,7 +290,7 @@ public static Product deleteProductById(final String id, final Long version) {
}
return CompletableFuture.completedFuture(productApiHttpResponse);
})
- .thenComposeAsync(productApiHttpResponse -> CommercetoolsTestUtils.getProjectRoot()
+ .thenComposeAsync(productApiHttpResponse -> CommercetoolsTestUtils.getProjectApiRoot()
.products()
.withId(productApiHttpResponse.getBody().getId())
.delete()
@@ -308,7 +308,7 @@ public static Product deleteProductById(final String id, final Long version) {
}
public static Product deleteProductByKey(final String key, final Long version) {
- Product product = CommercetoolsTestUtils.getProjectRoot()
+ Product product = CommercetoolsTestUtils.getProjectApiRoot()
.products()
.withKey(key)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product/ProductIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product/ProductIntegrationTests.java
index be08f3e6581..9a5458f96f0 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product/ProductIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product/ProductIntegrationTests.java
@@ -8,6 +8,7 @@
import java.util.List;
import com.commercetools.api.client.ByProjectKeyRequestBuilder;
+import com.commercetools.api.client.ProjectApiRoot;
import com.commercetools.api.models.common.LocalizedString;
import com.commercetools.api.models.product.*;
import commercetools.utils.CommercetoolsTestUtils;
@@ -30,7 +31,7 @@ public void createAndDeleteById() {
@Test
public void getById() {
ProductFixtures.withProduct(product -> {
- Product queriedProduct = CommercetoolsTestUtils.getProjectRoot()
+ Product queriedProduct = CommercetoolsTestUtils.getProjectApiRoot()
.products()
.withId(product.getId())
.get()
@@ -44,7 +45,7 @@ public void getById() {
@Test
public void getByKey() {
ProductFixtures.withProduct(product -> {
- Product queriedProduct = CommercetoolsTestUtils.getProjectRoot()
+ Product queriedProduct = CommercetoolsTestUtils.getProjectApiRoot()
.products()
.withKey(product.getKey())
.get()
@@ -62,7 +63,7 @@ public void updateById() {
LocalizedString newName = CommercetoolsTestUtils.randomLocalizedString();
updateActions.add(ProductChangeNameActionBuilder.of().name(newName).build());
- Product updatedProduct = CommercetoolsTestUtils.getProjectRoot()
+ Product updatedProduct = CommercetoolsTestUtils.getProjectApiRoot()
.products()
.withId(product.getId())
.post(ProductUpdateBuilder.of().actions(updateActions).version(product.getVersion()).build())
@@ -82,7 +83,7 @@ public void updateByKey() {
LocalizedString newName = CommercetoolsTestUtils.randomLocalizedString();
updateActions.add(ProductChangeNameActionBuilder.of().name(newName).build());
- Product updatedProduct = CommercetoolsTestUtils.getProjectRoot()
+ Product updatedProduct = CommercetoolsTestUtils.getProjectApiRoot()
.products()
.withKey(product.getKey())
.post(ProductUpdateBuilder.of().actions(updateActions).version(product.getVersion()).build())
@@ -98,7 +99,7 @@ public void updateByKey() {
@Test
public void query() {
ProductFixtures.withProduct(product -> {
- ProductPagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ ProductPagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.products()
.get()
.withWhere("id=" + "\"" + product.getId() + "\"")
@@ -126,7 +127,7 @@ public void upload() {
imageFile = new File("src/integrationTest/resources/ct_logo_farbe.gif");
}
- final ByProjectKeyRequestBuilder projectRoot = CommercetoolsTestUtils.getProjectRoot();
+ final ProjectApiRoot projectRoot = CommercetoolsTestUtils.getProjectApiRoot();
final Product result = projectRoot.products()
.withId(product.getId())
.images()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product_discount/ProductDiscountFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product_discount/ProductDiscountFixtures.java
index 9956affdc11..f234559a126 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product_discount/ProductDiscountFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product_discount/ProductDiscountFixtures.java
@@ -27,7 +27,7 @@ public static void withUpdateableProductDiscount(final UnaryOperator {
- ProductDiscount queriedProductDiscount = CommercetoolsTestUtils.getProjectRoot()
+ ProductDiscount queriedProductDiscount = CommercetoolsTestUtils.getProjectApiRoot()
.productDiscounts()
.withId(productDiscount.getId())
.get()
@@ -67,7 +67,7 @@ public void getById() {
@Test
public void getByKey() {
ProductDiscountFixtures.withProductDiscount(productDiscount -> {
- ProductDiscount queriedProductDiscount = CommercetoolsTestUtils.getProjectRoot()
+ ProductDiscount queriedProductDiscount = CommercetoolsTestUtils.getProjectApiRoot()
.productDiscounts()
.withKey(productDiscount.getKey())
.get()
@@ -82,7 +82,7 @@ public void getByKey() {
@Test
public void query() {
ProductDiscountFixtures.withProductDiscount(productDiscount -> {
- ProductDiscountPagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ ProductDiscountPagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.productDiscounts()
.get()
.withWhere("id=" + "\"" + productDiscount.getId() + "\"")
@@ -100,7 +100,7 @@ public void updateById() {
List updateActions = new ArrayList<>();
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(ProductDiscountSetKeyActionBuilder.of().key(newKey).build());
- ProductDiscount updatedProductDiscount = CommercetoolsTestUtils.getProjectRoot()
+ ProductDiscount updatedProductDiscount = CommercetoolsTestUtils.getProjectApiRoot()
.productDiscounts()
.withId(productDiscount.getId())
.post(ProductDiscountUpdateBuilder.of()
@@ -122,7 +122,7 @@ public void updateByKey() {
List updateActions = new ArrayList<>();
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(ProductDiscountSetKeyActionBuilder.of().key(newKey).build());
- ProductDiscount updatedProductDiscount = CommercetoolsTestUtils.getProjectRoot()
+ ProductDiscount updatedProductDiscount = CommercetoolsTestUtils.getProjectApiRoot()
.productDiscounts()
.withKey(productDiscount.getKey())
.post(ProductDiscountUpdateBuilder.of()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product_projection/ProductProjectionIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product_projection/ProductProjectionIntegrationTests.java
index cb61acba363..33796e8656a 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product_projection/ProductProjectionIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product_projection/ProductProjectionIntegrationTests.java
@@ -18,7 +18,7 @@ public class ProductProjectionIntegrationTests {
@Test
public void getById() {
ProductFixtures.withProduct(product -> {
- ProductProjection productProjection = CommercetoolsTestUtils.getProjectRoot()
+ ProductProjection productProjection = CommercetoolsTestUtils.getProjectApiRoot()
.productProjections()
.withId(product.getId())
.get()
@@ -33,7 +33,7 @@ public void getById() {
@Test
public void getByKey() {
ProductFixtures.withProduct(product -> {
- ProductProjection productProjection = CommercetoolsTestUtils.getProjectRoot()
+ ProductProjection productProjection = CommercetoolsTestUtils.getProjectApiRoot()
.productProjections()
.withKey(product.getKey())
.get()
@@ -49,7 +49,7 @@ public void getByKey() {
public void query() {
ProductFixtures.withProduct(product -> {
ProductProjectionPagedQueryResponse productProjectionPagedQueryResponse = CommercetoolsTestUtils
- .getProjectRoot()
+ .getProjectApiRoot()
.productProjections()
.get()
.withStaged(true)
@@ -64,7 +64,7 @@ public void query() {
@Test
public void search() {
ProductFixtures.withProduct(product -> {
- ProductProjectionPagedSearchResponse searchResponse = CommercetoolsTestUtils.getProjectRoot()
+ ProductProjectionPagedSearchResponse searchResponse = CommercetoolsTestUtils.getProjectApiRoot()
.productProjections()
.search()
.get()
@@ -81,7 +81,7 @@ public void search() {
@Test
public void attribute() {
ProductFixtures.withProduct(product -> {
- ProductProjection productProjection = CommercetoolsTestUtils.getProjectRoot()
+ ProductProjection productProjection = CommercetoolsTestUtils.getProjectApiRoot()
.productProjections()
.withKey(product.getKey())
.get()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product_type/ProductTypeFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product_type/ProductTypeFixtures.java
index 0c56da18488..f2f0dee006a 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product_type/ProductTypeFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product_type/ProductTypeFixtures.java
@@ -44,7 +44,7 @@ public static ProductType createProductType() {
.attributes(Arrays.asList(attributeDefinitionDraft))
.build();
- ProductType productType = CommercetoolsTestUtils.getProjectRoot()
+ ProductType productType = CommercetoolsTestUtils.getProjectApiRoot()
.productTypes()
.post(productTypeDraft)
.executeBlocking()
@@ -58,7 +58,7 @@ public static ProductType createProductType() {
}
public static ProductType deleteProductType(final String id, final Long version) {
- ProductType deletedProductType = CommercetoolsTestUtils.getProjectRoot()
+ ProductType deletedProductType = CommercetoolsTestUtils.getProjectApiRoot()
.productTypes()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product_type/ProductTypeIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product_type/ProductTypeIntegrationTests.java
index 48145a7b7c9..d9ffbde88c5 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product_type/ProductTypeIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product_type/ProductTypeIntegrationTests.java
@@ -24,7 +24,7 @@ public void createAndDeleteById() {
@Test
public void getById() {
ProductTypeFixtures.withProductType(productType -> {
- ProductType queriedProductType = CommercetoolsTestUtils.getProjectRoot()
+ ProductType queriedProductType = CommercetoolsTestUtils.getProjectApiRoot()
.productTypes()
.withId(productType.getId())
.get()
@@ -39,7 +39,7 @@ public void getById() {
@Test
public void getByKey() {
ProductTypeFixtures.withProductType(productType -> {
- ProductType queriedProductType = CommercetoolsTestUtils.getProjectRoot()
+ ProductType queriedProductType = CommercetoolsTestUtils.getProjectApiRoot()
.productTypes()
.withKey(productType.getKey())
.get()
@@ -54,7 +54,7 @@ public void getByKey() {
@Test
public void query() {
ProductTypeFixtures.withProductType(productType -> {
- ProductTypePagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ ProductTypePagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.productTypes()
.get()
.withWhere("id=" + "\"" + productType.getId() + "\"")
@@ -72,7 +72,7 @@ public void updateById() {
List updateActions = new ArrayList<>();
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(ProductTypeSetKeyActionBuilder.of().key(newKey).build());
- ProductType updatedProductType = CommercetoolsTestUtils.getProjectRoot()
+ ProductType updatedProductType = CommercetoolsTestUtils.getProjectApiRoot()
.productTypes()
.withId(productType.getId())
.post(
@@ -93,7 +93,7 @@ public void updateByKey() {
List updateActions = new ArrayList<>();
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(ProductTypeSetKeyActionBuilder.of().key(newKey).build());
- ProductType updatedProductType = CommercetoolsTestUtils.getProjectRoot()
+ ProductType updatedProductType = CommercetoolsTestUtils.getProjectApiRoot()
.productTypes()
.withKey(productType.getKey())
.post(
@@ -111,7 +111,7 @@ public void updateByKey() {
@Test
public void deleteByKey() {
ProductType productType = ProductTypeFixtures.createProductType();
- ProductType deletedProductType = CommercetoolsTestUtils.getProjectRoot()
+ ProductType deletedProductType = CommercetoolsTestUtils.getProjectApiRoot()
.productTypes()
.withKey(productType.getKey())
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/project/ProjectIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/project/ProjectIntegrationTests.java
index e97ef2eefa6..1960144c91f 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/project/ProjectIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/project/ProjectIntegrationTests.java
@@ -19,7 +19,7 @@ public class ProjectIntegrationTests {
@Test
public void byKeyGet() throws Exception {
String projectKey = CommercetoolsTestUtils.getProjectKey();
- Project project = CommercetoolsTestUtils.getProjectRoot().get().executeBlocking().getBody();
+ Project project = CommercetoolsTestUtils.getProjectApiRoot().get().executeBlocking().getBody();
Assert.assertNotNull(project);
Assert.assertEquals(projectKey, project.getKey());
}
@@ -29,8 +29,8 @@ public void updateProject() throws Exception {
List countries = Arrays.asList("DE");
List updateActions = new ArrayList<>();
updateActions.add(ProjectChangeCountriesActionBuilder.of().countries(countries).build());
- Project project = CommercetoolsTestUtils.getProjectRoot().get().executeBlocking().getBody();
- Project updatedProject = CommercetoolsTestUtils.getProjectRoot()
+ Project project = CommercetoolsTestUtils.getProjectApiRoot().get().executeBlocking().getBody();
+ Project updatedProject = CommercetoolsTestUtils.getProjectApiRoot()
.post(ProjectUpdateBuilder.of().actions(updateActions).version(project.getVersion()).build())
.executeBlocking()
.getBody();
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/request_errors/CategoryErrorHandlingIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/request_errors/CategoryErrorHandlingIntegrationTests.java
index aeedb56a373..5b7060e104f 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/request_errors/CategoryErrorHandlingIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/request_errors/CategoryErrorHandlingIntegrationTests.java
@@ -16,7 +16,7 @@ public class CategoryErrorHandlingIntegrationTests {
@Test(expected = RuntimeException.class)
public void getByNonExistingIdBlocking() {
CategoryFixtures.withCategory(category -> {
- CommercetoolsTestUtils.getProjectRoot()
+ CommercetoolsTestUtils.getProjectApiRoot()
.categories()
.withId("non-existing")
.get()
@@ -28,7 +28,7 @@ public void getByNonExistingIdBlocking() {
@Test
public void getByNonExistingIdNonBlocking() {
CategoryFixtures.withCategory(category -> {
- CommercetoolsTestUtils.getProjectRoot()
+ CommercetoolsTestUtils.getProjectApiRoot()
.categories()
.withId("non-existing")
.get()
@@ -46,7 +46,7 @@ public void getByNonExistingIdNonBlocking() {
@Test
public void deleteWithoutVersionNonBlocking() {
CategoryFixtures.withUpdateableCategory(category -> {
- CommercetoolsTestUtils.getProjectRoot()
+ CommercetoolsTestUtils.getProjectApiRoot()
.categories()
.withId(category.getId())
.delete()
@@ -67,7 +67,7 @@ public void deleteWithoutVersionNonBlocking() {
public void deleteWithoutVersionBlocking() {
CategoryFixtures.withUpdateableCategory(category -> {
try {
- CommercetoolsTestUtils.getProjectRoot()
+ CommercetoolsTestUtils.getProjectApiRoot()
.categories()
.withId(category.getId())
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/review/ReviewFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/review/ReviewFixtures.java
index 7ed331a1bf5..716afefb3d5 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/review/ReviewFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/review/ReviewFixtures.java
@@ -42,7 +42,7 @@ public static Review createReview() {
.key(CommercetoolsTestUtils.randomKey())
.build();
- State state = CommercetoolsTestUtils.getProjectRoot().states().post(stateDraft).executeBlocking().getBody();
+ State state = CommercetoolsTestUtils.getProjectApiRoot().states().post(stateDraft).executeBlocking().getBody();
ReviewDraft reviewDraft = ReviewDraftBuilder.of()
.key(CommercetoolsTestUtils.randomKey())
@@ -58,7 +58,7 @@ public static Review createReview() {
.customer(CustomerResourceIdentifierBuilder.of().id(customer.getId()).build())
.build();
- Review review = CommercetoolsTestUtils.getProjectRoot().reviews().post(reviewDraft).executeBlocking().getBody();
+ Review review = CommercetoolsTestUtils.getProjectApiRoot().reviews().post(reviewDraft).executeBlocking().getBody();
Assert.assertNotNull(review);
Assert.assertEquals(reviewDraft.getKey(), review.getKey());
@@ -67,7 +67,7 @@ public static Review createReview() {
}
public static Review delete(final String id, final Long version) {
- Review deletedReview = CommercetoolsTestUtils.getProjectRoot()
+ Review deletedReview = CommercetoolsTestUtils.getProjectApiRoot()
.reviews()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/review/ReviewIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/review/ReviewIntegrationTests.java
index 397b19a8857..1bc214c93d5 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/review/ReviewIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/review/ReviewIntegrationTests.java
@@ -19,12 +19,12 @@ public void createAndDelete() {
.title("review-title-1")
.build();
- Review review = CommercetoolsTestUtils.getProjectRoot().reviews().post(reviewDraft).executeBlocking().getBody();
+ Review review = CommercetoolsTestUtils.getProjectApiRoot().reviews().post(reviewDraft).executeBlocking().getBody();
Assert.assertNotNull(review);
Assert.assertEquals(reviewDraft.getKey(), review.getKey());
- Review deletedReview = CommercetoolsTestUtils.getProjectRoot()
+ Review deletedReview = CommercetoolsTestUtils.getProjectApiRoot()
.reviews()
.withId(review.getId())
.delete()
@@ -39,7 +39,7 @@ public void createAndDelete() {
@Test
public void getById() {
ReviewFixtures.withReview(review -> {
- Review queriedReview = CommercetoolsTestUtils.getProjectRoot()
+ Review queriedReview = CommercetoolsTestUtils.getProjectApiRoot()
.reviews()
.withId(review.getId())
.get()
@@ -53,7 +53,7 @@ public void getById() {
@Test
public void getByKey() {
ReviewFixtures.withReview(review -> {
- Review queriedReview = CommercetoolsTestUtils.getProjectRoot()
+ Review queriedReview = CommercetoolsTestUtils.getProjectApiRoot()
.reviews()
.withKey(review.getKey())
.get()
@@ -67,7 +67,7 @@ public void getByKey() {
@Test
public void query() {
ReviewFixtures.withReview(review -> {
- ReviewPagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ ReviewPagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.reviews()
.get()
.withWhere("id=" + "\"" + review.getId() + "\"")
@@ -85,7 +85,7 @@ public void updateById() {
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(ReviewSetKeyActionBuilder.of().key(newKey).build());
- Review updatedReview = CommercetoolsTestUtils.getProjectRoot()
+ Review updatedReview = CommercetoolsTestUtils.getProjectApiRoot()
.reviews()
.withId(review.getId())
.post(ReviewUpdateBuilder.of().actions(updateActions).version(review.getVersion()).build())
@@ -106,7 +106,7 @@ public void updateByKey() {
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(ReviewSetKeyActionBuilder.of().key(newKey).build());
- Review updatedReview = CommercetoolsTestUtils.getProjectRoot()
+ Review updatedReview = CommercetoolsTestUtils.getProjectApiRoot()
.reviews()
.withKey(review.getKey())
.post(ReviewUpdateBuilder.of().actions(updateActions).version(review.getVersion()).build())
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/shipping_method/ShippingMethodFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/shipping_method/ShippingMethodFixtures.java
index 3d78c6e4a43..318b8629604 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/shipping_method/ShippingMethodFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/shipping_method/ShippingMethodFixtures.java
@@ -53,7 +53,7 @@ public static ShippingMethod createShippingMethod() {
.isDefault(false)
.build();
- ShippingMethod shippingMethod = CommercetoolsTestUtils.getProjectRoot()
+ ShippingMethod shippingMethod = CommercetoolsTestUtils.getProjectApiRoot()
.shippingMethods()
.post(shippingMethodDraft)
.executeBlocking()
@@ -66,7 +66,7 @@ public static ShippingMethod createShippingMethod() {
}
public static ShippingMethod deleteShippingMethod(final String id, final Long version) {
- ShippingMethod shippingMethod = CommercetoolsTestUtils.getProjectRoot()
+ ShippingMethod shippingMethod = CommercetoolsTestUtils.getProjectApiRoot()
.shippingMethods()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/shipping_method/ShippingMethodIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/shipping_method/ShippingMethodIntegrationTests.java
index 9f1bde59e4d..a4eb98a09e3 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/shipping_method/ShippingMethodIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/shipping_method/ShippingMethodIntegrationTests.java
@@ -21,7 +21,7 @@ public void createAndDeleteById() {
@Test
public void getById() {
ShippingMethodFixtures.withShippingMethod(shippingMethod -> {
- ShippingMethod queriedShippingMethod = CommercetoolsTestUtils.getProjectRoot()
+ ShippingMethod queriedShippingMethod = CommercetoolsTestUtils.getProjectApiRoot()
.shippingMethods()
.withId(shippingMethod.getId())
.get()
@@ -36,7 +36,7 @@ public void getById() {
@Test
public void getByKey() {
ShippingMethodFixtures.withShippingMethod(shippingMethod -> {
- ShippingMethod queriedShippingMethod = CommercetoolsTestUtils.getProjectRoot()
+ ShippingMethod queriedShippingMethod = CommercetoolsTestUtils.getProjectApiRoot()
.shippingMethods()
.withKey(shippingMethod.getKey())
.get()
@@ -51,7 +51,7 @@ public void getByKey() {
@Test
public void query() {
ShippingMethodFixtures.withShippingMethod(shippingMethod -> {
- ShippingMethodPagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ ShippingMethodPagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.shippingMethods()
.get()
.withWhere("id=" + "\"" + shippingMethod.getId() + "\"")
@@ -70,7 +70,7 @@ public void updateById() {
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(ShippingMethodSetKeyActionBuilder.of().key(newKey).build());
- ShippingMethod updatedShippingMethod = CommercetoolsTestUtils.getProjectRoot()
+ ShippingMethod updatedShippingMethod = CommercetoolsTestUtils.getProjectApiRoot()
.shippingMethods()
.withId(shippingMethod.getId())
.post(ShippingMethodUpdateBuilder.of()
@@ -94,7 +94,7 @@ public void updateByKey() {
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(ShippingMethodSetKeyActionBuilder.of().key(newKey).build());
- ShippingMethod updatedShippingMethod = CommercetoolsTestUtils.getProjectRoot()
+ ShippingMethod updatedShippingMethod = CommercetoolsTestUtils.getProjectApiRoot()
.shippingMethods()
.withKey(shippingMethod.getKey())
.post(ShippingMethodUpdateBuilder.of()
@@ -114,7 +114,7 @@ public void updateByKey() {
@Test
public void deleteByKey() {
ShippingMethod shippingMethod = ShippingMethodFixtures.createShippingMethod();
- ShippingMethod deletedShippingMethod = CommercetoolsTestUtils.getProjectRoot()
+ ShippingMethod deletedShippingMethod = CommercetoolsTestUtils.getProjectApiRoot()
.shippingMethods()
.withKey(shippingMethod.getKey())
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/shopping_list/ShoppingListFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/shopping_list/ShoppingListFixtures.java
index 3f03177e2be..706adb863ff 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/shopping_list/ShoppingListFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/shopping_list/ShoppingListFixtures.java
@@ -51,7 +51,7 @@ public static ShoppingList createShoppingList() {
.deleteDaysAfterLastModification(2L)
.build();
- ShoppingList shoppingList = CommercetoolsTestUtils.getProjectRoot()
+ ShoppingList shoppingList = CommercetoolsTestUtils.getProjectApiRoot()
.shoppingLists()
.post(shoppingListDraft)
.executeBlocking()
@@ -64,7 +64,7 @@ public static ShoppingList createShoppingList() {
}
public static ShoppingList deleteShoppingList(final String id, final Long version) {
- ShoppingList shoppingList = CommercetoolsTestUtils.getProjectRoot()
+ ShoppingList shoppingList = CommercetoolsTestUtils.getProjectApiRoot()
.shoppingLists()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/shopping_list/ShoppingListIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/shopping_list/ShoppingListIntegrationTests.java
index 968ffd66baa..d90acd2c748 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/shopping_list/ShoppingListIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/shopping_list/ShoppingListIntegrationTests.java
@@ -21,7 +21,7 @@ public void createAndDeleteById() {
@Test
public void getById() {
ShoppingListFixtures.withShoppingList(shoppingList -> {
- ShoppingList queriedShoppingList = CommercetoolsTestUtils.getProjectRoot()
+ ShoppingList queriedShoppingList = CommercetoolsTestUtils.getProjectApiRoot()
.shoppingLists()
.withId(shoppingList.getId())
.get()
@@ -36,7 +36,7 @@ public void getById() {
@Test
public void getByKey() {
ShoppingListFixtures.withShoppingList(shoppingList -> {
- ShoppingList queriedShoppingList = CommercetoolsTestUtils.getProjectRoot()
+ ShoppingList queriedShoppingList = CommercetoolsTestUtils.getProjectApiRoot()
.shoppingLists()
.withKey(shoppingList.getKey())
.get()
@@ -51,7 +51,7 @@ public void getByKey() {
@Test
public void query() {
ShoppingListFixtures.withShoppingList(shoppingList -> {
- ShoppingListPagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ ShoppingListPagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.shoppingLists()
.get()
.withWhere("id=" + "\"" + shoppingList.getId() + "\"")
@@ -71,7 +71,7 @@ public void updateByKey() {
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(ShoppingListSetKeyActionBuilder.of().key(newKey).build());
- ShoppingList updatedShoppingList = CommercetoolsTestUtils.getProjectRoot()
+ ShoppingList updatedShoppingList = CommercetoolsTestUtils.getProjectApiRoot()
.shoppingLists()
.withKey(shoppingList.getKey())
.post(ShoppingListUpdateBuilder.of()
@@ -96,7 +96,7 @@ public void updateById() {
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(ShoppingListSetKeyActionBuilder.of().key(newKey).build());
- ShoppingList updatedShoppingList = CommercetoolsTestUtils.getProjectRoot()
+ ShoppingList updatedShoppingList = CommercetoolsTestUtils.getProjectApiRoot()
.shoppingLists()
.withId(shoppingList.getId())
.post(ShoppingListUpdateBuilder.of()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/state/StateFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/state/StateFixtures.java
index 7bab0e8727e..78bbd45ee69 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/state/StateFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/state/StateFixtures.java
@@ -31,7 +31,7 @@ public static State createState() {
.roles(Arrays.asList(StateRoleEnum.RETURN))
.build();
- State state = CommercetoolsTestUtils.getProjectRoot().states().post(stateDraft).executeBlocking().getBody();
+ State state = CommercetoolsTestUtils.getProjectApiRoot().states().post(stateDraft).executeBlocking().getBody();
Assert.assertNotNull(state);
Assert.assertEquals(stateDraft.getKey(), state.getKey());
@@ -40,7 +40,7 @@ public static State createState() {
}
public static State deleteState(final String id, final Long version) {
- State state = CommercetoolsTestUtils.getProjectRoot()
+ State state = CommercetoolsTestUtils.getProjectApiRoot()
.states()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/state/StateIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/state/StateIntegrationTests.java
index 41501640f12..1139dde1ce9 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/state/StateIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/state/StateIntegrationTests.java
@@ -22,7 +22,7 @@ public void createAndDeleteById() {
@Test
public void getById() {
StateFixtures.withState(state -> {
- State queriedState = CommercetoolsTestUtils.getProjectRoot()
+ State queriedState = CommercetoolsTestUtils.getProjectApiRoot()
.states()
.withId(state.getId())
.get()
@@ -37,7 +37,7 @@ public void getById() {
@Test
public void query() {
StateFixtures.withState(state -> {
- StatePagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ StatePagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.states()
.get()
.withWhere("id=" + "\"" + state.getId() + "\"")
@@ -55,7 +55,7 @@ public void update() {
List updateActions = new ArrayList<>();
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(StateChangeKeyActionBuilder.of().key(newKey).build());
- State updatedState = CommercetoolsTestUtils.getProjectRoot()
+ State updatedState = CommercetoolsTestUtils.getProjectApiRoot()
.states()
.withId(state.getId())
.post(StateUpdateBuilder.of().actions(updateActions).version(state.getVersion()).build())
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/store/StoreFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/store/StoreFixtures.java
index 55c68a425da..32aa30b6566 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/store/StoreFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/store/StoreFixtures.java
@@ -28,7 +28,7 @@ public static void withUpdateableStore(final UnaryOperator operator) {
public static Store createStore() {
StoreDraft storeDraft = StoreDraftBuilder.of().key(CommercetoolsTestUtils.randomKey()).build();
- Store store = CommercetoolsTestUtils.getProjectRoot().stores().post(storeDraft).executeBlocking().getBody();
+ Store store = CommercetoolsTestUtils.getProjectApiRoot().stores().post(storeDraft).executeBlocking().getBody();
Assert.assertNotNull(store);
Assert.assertEquals(storeDraft.getKey(), store.getKey());
@@ -37,7 +37,7 @@ public static Store createStore() {
}
public static Store deleteStore(final String id, final Long version) {
- Store store = CommercetoolsTestUtils.getProjectRoot()
+ Store store = CommercetoolsTestUtils.getProjectApiRoot()
.stores()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/store/StoreIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/store/StoreIntegrationTests.java
index 71f05cd917f..4e4e8bb44c8 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/store/StoreIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/store/StoreIntegrationTests.java
@@ -24,7 +24,7 @@ public void createAndDeleteById() {
@Test
public void getById() {
StoreFixtures.withStore(store -> {
- Store queriedStore = CommercetoolsTestUtils.getProjectRoot()
+ Store queriedStore = CommercetoolsTestUtils.getProjectApiRoot()
.stores()
.withId(store.getId())
.get()
@@ -39,7 +39,7 @@ public void getById() {
@Test
public void getByKey() {
StoreFixtures.withStore(store -> {
- Store queriedStore = CommercetoolsTestUtils.getProjectRoot()
+ Store queriedStore = CommercetoolsTestUtils.getProjectApiRoot()
.stores()
.withKey(store.getKey())
.get()
@@ -54,7 +54,7 @@ public void getByKey() {
@Test
public void query() {
StoreFixtures.withStore(store -> {
- StorePagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ StorePagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.stores()
.get()
.withWhere("id=" + "\"" + store.getId() + "\"")
@@ -73,7 +73,7 @@ public void updateById() {
LocalizedString newName = CommercetoolsTestUtils.randomLocalizedString();
updateActions.add(StoreSetNameActionBuilder.of().name(newName).build());
- Store updatedStore = CommercetoolsTestUtils.getProjectRoot()
+ Store updatedStore = CommercetoolsTestUtils.getProjectApiRoot()
.stores()
.withId(store.getId())
.post(StoreUpdateBuilder.of().actions(updateActions).version(store.getVersion()).build())
@@ -93,7 +93,7 @@ public void updateByKey() {
LocalizedString newName = CommercetoolsTestUtils.randomLocalizedString();
updateActions.add(StoreSetNameActionBuilder.of().name(newName).build());
- Store updatedStore = CommercetoolsTestUtils.getProjectRoot()
+ Store updatedStore = CommercetoolsTestUtils.getProjectApiRoot()
.stores()
.withKey(store.getKey())
.post(StoreUpdateBuilder.of().actions(updateActions).version(store.getVersion()).build())
@@ -109,7 +109,7 @@ public void updateByKey() {
@Test
public void deleteByKey() {
Store store = StoreFixtures.createStore();
- Store deletedStore = CommercetoolsTestUtils.getProjectRoot()
+ Store deletedStore = CommercetoolsTestUtils.getProjectApiRoot()
.stores()
.withKey(store.getKey())
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/subscription/SubscriptionFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/subscription/SubscriptionFixtures.java
index a969f4831b5..0c18f478f0e 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/subscription/SubscriptionFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/subscription/SubscriptionFixtures.java
@@ -32,7 +32,7 @@ public static Subscription createSubscription() {
.messages(Arrays.asList(MessageSubscriptionBuilder.of().resourceTypeId("review").build()))
.build();
- Subscription subscription = CommercetoolsTestUtils.getProjectRoot()
+ Subscription subscription = CommercetoolsTestUtils.getProjectApiRoot()
.subscriptions()
.post(subscriptionDraft)
.executeBlocking()
@@ -44,7 +44,7 @@ public static Subscription createSubscription() {
}
public static Subscription deleteSubscription(final String id, final Long version) {
- Subscription subscription = CommercetoolsTestUtils.getProjectRoot()
+ Subscription subscription = CommercetoolsTestUtils.getProjectApiRoot()
.subscriptions()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/tax_category/TaxCategoryFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/tax_category/TaxCategoryFixtures.java
index 248d6b78a1e..1f9a8282d1a 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/tax_category/TaxCategoryFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/tax_category/TaxCategoryFixtures.java
@@ -40,7 +40,7 @@ public static TaxCategory createTaxCategory() {
.build())
.build();
- TaxCategory taxCategory = CommercetoolsTestUtils.getProjectRoot()
+ TaxCategory taxCategory = CommercetoolsTestUtils.getProjectApiRoot()
.taxCategories()
.post(taxCategoryDraft)
.executeBlocking()
@@ -54,7 +54,7 @@ public static TaxCategory createTaxCategory() {
}
public static TaxCategory deleteTaxCategory(final String id, final Long version) {
- TaxCategory deletedTaxCategory = CommercetoolsTestUtils.getProjectRoot()
+ TaxCategory deletedTaxCategory = CommercetoolsTestUtils.getProjectApiRoot()
.taxCategories()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/tax_category/TaxCategoryIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/tax_category/TaxCategoryIntegrationTests.java
index b0b2b4b0221..b419fc2dd5b 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/tax_category/TaxCategoryIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/tax_category/TaxCategoryIntegrationTests.java
@@ -26,7 +26,7 @@ public void createAndDelete() {
.build())
.build();
- TaxCategory taxCategory = CommercetoolsTestUtils.getProjectRoot()
+ TaxCategory taxCategory = CommercetoolsTestUtils.getProjectApiRoot()
.taxCategories()
.post(taxCategoryDraft)
.executeBlocking()
@@ -36,7 +36,7 @@ public void createAndDelete() {
Assert.assertEquals(taxCategoryDraft.getName(), taxCategory.getName());
Assert.assertEquals(taxCategoryDraft.getKey(), taxCategory.getKey());
- TaxCategory deletedTaxCategory = CommercetoolsTestUtils.getProjectRoot()
+ TaxCategory deletedTaxCategory = CommercetoolsTestUtils.getProjectApiRoot()
.taxCategories()
.withId(taxCategory.getId())
.delete()
@@ -51,7 +51,7 @@ public void createAndDelete() {
@Test
public void getById() {
TaxCategoryFixtures.withTaxCategory(taxCategory -> {
- TaxCategory queriedTaxCategory = CommercetoolsTestUtils.getProjectRoot()
+ TaxCategory queriedTaxCategory = CommercetoolsTestUtils.getProjectApiRoot()
.taxCategories()
.withId(taxCategory.getId())
.get()
@@ -66,7 +66,7 @@ public void getById() {
@Test
public void getByKey() {
TaxCategoryFixtures.withTaxCategory(taxCategory -> {
- TaxCategory queriedTaxCategory = CommercetoolsTestUtils.getProjectRoot()
+ TaxCategory queriedTaxCategory = CommercetoolsTestUtils.getProjectApiRoot()
.taxCategories()
.withKey(taxCategory.getKey())
.get()
@@ -81,7 +81,7 @@ public void getByKey() {
@Test
public void query() {
TaxCategoryFixtures.withTaxCategory(taxCategory -> {
- TaxCategoryPagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ TaxCategoryPagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.taxCategories()
.get()
.withWhere("id=" + "\"" + taxCategory.getId() + "\"")
@@ -101,7 +101,7 @@ public void updateById() {
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(TaxCategorySetKeyActionBuilder.of().key(newKey).build());
- TaxCategory updatedTaxCategory = CommercetoolsTestUtils.getProjectRoot()
+ TaxCategory updatedTaxCategory = CommercetoolsTestUtils.getProjectApiRoot()
.taxCategories()
.withId(taxCategory.getId())
.post(
@@ -124,7 +124,7 @@ public void updateByIKey() {
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(TaxCategorySetKeyActionBuilder.of().key(newKey).build());
- TaxCategory updatedTaxCategory = CommercetoolsTestUtils.getProjectRoot()
+ TaxCategory updatedTaxCategory = CommercetoolsTestUtils.getProjectApiRoot()
.taxCategories()
.withKey(taxCategory.getKey())
.post(
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/type/TypeFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/type/TypeFixtures.java
index c2706836dd5..853a776692b 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/type/TypeFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/type/TypeFixtures.java
@@ -38,7 +38,7 @@ public static Type createType() {
.build()))
.build();
- Type type = CommercetoolsTestUtils.getProjectRoot().types().post(typeDraft).executeBlocking().getBody();
+ Type type = CommercetoolsTestUtils.getProjectApiRoot().types().post(typeDraft).executeBlocking().getBody();
Assert.assertNotNull(type);
Assert.assertEquals(type.getKey(), typeDraft.getKey());
@@ -47,7 +47,7 @@ public static Type createType() {
}
public static Type deleteType(final String id, final Long version) {
- Type type = CommercetoolsTestUtils.getProjectRoot()
+ Type type = CommercetoolsTestUtils.getProjectApiRoot()
.types()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/type/TypeIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/type/TypeIntegrationTests.java
index cd1a37111ab..13bd0b85d8b 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/type/TypeIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/type/TypeIntegrationTests.java
@@ -23,7 +23,7 @@ public void createAndDeleteById() {
@Test
public void getById() {
TypeFixtures.withType(type -> {
- Type queriedType = CommercetoolsTestUtils.getProjectRoot()
+ Type queriedType = CommercetoolsTestUtils.getProjectApiRoot()
.types()
.withId(type.getId())
.get()
@@ -38,7 +38,7 @@ public void getById() {
@Test
public void getByKey() {
TypeFixtures.withType(type -> {
- Type queriedType = CommercetoolsTestUtils.getProjectRoot()
+ Type queriedType = CommercetoolsTestUtils.getProjectApiRoot()
.types()
.withKey(type.getKey())
.get()
@@ -53,7 +53,7 @@ public void getByKey() {
@Test
public void query() {
TypeFixtures.withType(type -> {
- TypePagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ TypePagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.types()
.get()
.withWhere("id=" + "\"" + type.getId() + "\"")
@@ -72,7 +72,7 @@ public void updateById() {
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(TypeChangeKeyActionBuilder.of().key(newKey).build());
- Type updatedType = CommercetoolsTestUtils.getProjectRoot()
+ Type updatedType = CommercetoolsTestUtils.getProjectApiRoot()
.types()
.withId(type.getId())
.post(TypeUpdateBuilder.of().actions(updateActions).version(type.getVersion()).build())
@@ -93,7 +93,7 @@ public void updateByKey() {
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(TypeChangeKeyActionBuilder.of().key(newKey).build());
- Type updatedType = CommercetoolsTestUtils.getProjectRoot()
+ Type updatedType = CommercetoolsTestUtils.getProjectApiRoot()
.types()
.withKey(type.getKey())
.post(TypeUpdateBuilder.of().actions(updateActions).version(type.getVersion()).build())
@@ -110,7 +110,7 @@ public void updateByKey() {
@Test
public void deleteByKey() {
Type type = TypeFixtures.createType();
- Type deletedType = CommercetoolsTestUtils.getProjectRoot()
+ Type deletedType = CommercetoolsTestUtils.getProjectApiRoot()
.types()
.withKey(type.getKey())
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/utils/CommercetoolsTestUtils.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/utils/CommercetoolsTestUtils.java
index a6bffee9c6b..b3b6f086ee0 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/utils/CommercetoolsTestUtils.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/utils/CommercetoolsTestUtils.java
@@ -16,8 +16,6 @@
public class CommercetoolsTestUtils {
- private static final ApiHttpClient client;
- private static final ByProjectKeyRequestBuilder projectRoot;
private static final ProjectApiRoot projectApiRoot;
static {
@@ -31,8 +29,6 @@ public class CommercetoolsTestUtils {
.defaultClient(
ClientCredentials.of().withClientId(getClientId()).withClientSecret(getClientSecret()).build(),
authURL, apiUrl);
- client = builder.buildClient();
- projectRoot = ApiRootBuilder.createForProject(getProjectKey(), client);
projectApiRoot = builder.build(getProjectKey());
}
@@ -66,18 +62,10 @@ public static String getClientSecret() {
return System.getenv("CTP_CLIENT_SECRET");
}
- public static ByProjectKeyRequestBuilder getProjectRoot() {
- return projectRoot;
- }
-
public static ProjectApiRoot getProjectApiRoot() {
return projectApiRoot;
}
- public static ApiHttpClient getClient() {
- return client;
- }
-
public static void assertEventually(final Duration maxWaitTime, final Duration waitBeforeRetry,
final Runnable block) {
final long timeOutAt = System.currentTimeMillis() + maxWaitTime.toMillis();
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/zone/ZoneFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/zone/ZoneFixtures.java
index ef766b4d495..217b338cb33 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/zone/ZoneFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/zone/ZoneFixtures.java
@@ -32,7 +32,7 @@ public static Zone createZone() {
.description(CommercetoolsTestUtils.randomString())
.build();
- Zone zone = CommercetoolsTestUtils.getProjectRoot().zones().post(zoneDraft).executeBlocking().getBody();
+ Zone zone = CommercetoolsTestUtils.getProjectApiRoot().zones().post(zoneDraft).executeBlocking().getBody();
Assert.assertNotNull(zone);
Assert.assertEquals(zoneDraft.getKey(), zone.getKey());
@@ -41,7 +41,7 @@ public static Zone createZone() {
}
public static Zone deleteZone(final String id, final Long version) {
- Zone zone = CommercetoolsTestUtils.getProjectRoot()
+ Zone zone = CommercetoolsTestUtils.getProjectApiRoot()
.zones()
.withId(id)
.delete()
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/zone/ZoneIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/zone/ZoneIntegrationTests.java
index f7589141a43..47b744296d7 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/zone/ZoneIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/zone/ZoneIntegrationTests.java
@@ -24,7 +24,7 @@ public void createAndDeleteById() {
@Test
public void getById() {
ZoneFixtures.withZone(zone -> {
- Zone queriedZone = CommercetoolsTestUtils.getProjectRoot()
+ Zone queriedZone = CommercetoolsTestUtils.getProjectApiRoot()
.zones()
.withId(zone.getId())
.get()
@@ -39,7 +39,7 @@ public void getById() {
@Test
public void getByKey() {
ZoneFixtures.withZone(zone -> {
- Zone queriedZone = CommercetoolsTestUtils.getProjectRoot()
+ Zone queriedZone = CommercetoolsTestUtils.getProjectApiRoot()
.zones()
.withKey(zone.getKey())
.get()
@@ -54,7 +54,7 @@ public void getByKey() {
@Test
public void query() {
ZoneFixtures.withZone(zone -> {
- ZonePagedQueryResponse response = CommercetoolsTestUtils.getProjectRoot()
+ ZonePagedQueryResponse response = CommercetoolsTestUtils.getProjectApiRoot()
.zones()
.get()
.withWhere("id=" + "\"" + zone.getId() + "\"")
@@ -73,7 +73,7 @@ public void updateById() {
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(ZoneSetKeyActionBuilder.of().key(newKey).build());
- Zone updatedZone = CommercetoolsTestUtils.getProjectRoot()
+ Zone updatedZone = CommercetoolsTestUtils.getProjectApiRoot()
.zones()
.withId(zone.getId())
.post(ZoneUpdateBuilder.of().actions(updateActions).version(zone.getVersion()).build())
@@ -94,7 +94,7 @@ public void updateByKey() {
String newKey = CommercetoolsTestUtils.randomKey();
updateActions.add(ZoneSetKeyActionBuilder.of().key(newKey).build());
- Zone updatedZone = CommercetoolsTestUtils.getProjectRoot()
+ Zone updatedZone = CommercetoolsTestUtils.getProjectApiRoot()
.zones()
.withKey(zone.getKey())
.post(ZoneUpdateBuilder.of().actions(updateActions).version(zone.getVersion()).build())
From 3ef2f7f8343d4a2fce517bab19e48ef026f8164b Mon Sep 17 00:00:00 2001
From: Auto Mation
Date: Wed, 6 Oct 2021 10:54:09 +0000
Subject: [PATCH 5/5] spotless: Fix code style
---
.../java/commercetools/product/ProductIntegrationTests.java | 1 -
.../java/commercetools/review/ReviewFixtures.java | 6 +++++-
.../java/commercetools/review/ReviewIntegrationTests.java | 6 +++++-
.../java/commercetools/utils/CommercetoolsTestUtils.java | 2 --
4 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product/ProductIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product/ProductIntegrationTests.java
index 9a5458f96f0..d6d802d84ea 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product/ProductIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/product/ProductIntegrationTests.java
@@ -7,7 +7,6 @@
import java.util.ArrayList;
import java.util.List;
-import com.commercetools.api.client.ByProjectKeyRequestBuilder;
import com.commercetools.api.client.ProjectApiRoot;
import com.commercetools.api.models.common.LocalizedString;
import com.commercetools.api.models.product.*;
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/review/ReviewFixtures.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/review/ReviewFixtures.java
index 716afefb3d5..1efc55c7e54 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/review/ReviewFixtures.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/review/ReviewFixtures.java
@@ -58,7 +58,11 @@ public static Review createReview() {
.customer(CustomerResourceIdentifierBuilder.of().id(customer.getId()).build())
.build();
- Review review = CommercetoolsTestUtils.getProjectApiRoot().reviews().post(reviewDraft).executeBlocking().getBody();
+ Review review = CommercetoolsTestUtils.getProjectApiRoot()
+ .reviews()
+ .post(reviewDraft)
+ .executeBlocking()
+ .getBody();
Assert.assertNotNull(review);
Assert.assertEquals(reviewDraft.getKey(), review.getKey());
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/review/ReviewIntegrationTests.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/review/ReviewIntegrationTests.java
index 1bc214c93d5..12a831997d1 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/review/ReviewIntegrationTests.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/review/ReviewIntegrationTests.java
@@ -19,7 +19,11 @@ public void createAndDelete() {
.title("review-title-1")
.build();
- Review review = CommercetoolsTestUtils.getProjectApiRoot().reviews().post(reviewDraft).executeBlocking().getBody();
+ Review review = CommercetoolsTestUtils.getProjectApiRoot()
+ .reviews()
+ .post(reviewDraft)
+ .executeBlocking()
+ .getBody();
Assert.assertNotNull(review);
Assert.assertEquals(reviewDraft.getKey(), review.getKey());
diff --git a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/utils/CommercetoolsTestUtils.java b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/utils/CommercetoolsTestUtils.java
index b3b6f086ee0..682ee777770 100644
--- a/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/utils/CommercetoolsTestUtils.java
+++ b/commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/utils/CommercetoolsTestUtils.java
@@ -4,14 +4,12 @@
import java.time.Duration;
import java.util.UUID;
-import com.commercetools.api.client.ByProjectKeyRequestBuilder;
import com.commercetools.api.client.ProjectApiRoot;
import com.commercetools.api.defaultconfig.ApiRootBuilder;
import com.commercetools.api.defaultconfig.ServiceRegion;
import com.commercetools.api.models.common.LocalizedString;
import com.commercetools.api.models.common.LocalizedStringImpl;
-import io.vrap.rmf.base.client.ApiHttpClient;
import io.vrap.rmf.base.client.oauth2.ClientCredentials;
public class CommercetoolsTestUtils {