Skip to content

Commit 6ec0d3b

Browse files
authored
Merge pull request #1110 from commercetools/cleanup-project-after-sdk-v2-migration
Cleanup project after sdk v2 migration
2 parents 705be4d + 2de8a5a commit 6ec0d3b

41 files changed

Lines changed: 153 additions & 178 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ ext{
1919
caffeineVersion = '3.1.8'
2020
nexusStagingPluginVersion = '0.22.0'
2121
commonTextVersion = '1.11.0'
22-
commercetoolsJavaSDK2Version = '10.1.0'
2322
}
2423

2524
apply from: "$rootDir/gradle-scripts/repositories.gradle"
@@ -44,13 +43,14 @@ apply from: "$rootDir/gradle-scripts/mkdocs.gradle"
4443
apply from: "$rootDir/gradle-scripts/spotless.gradle"
4544

4645
dependencies {
47-
implementation "com.commercetools.sdk:commercetools-http-client:${commercetoolsJavaSDK2Version}"
48-
implementation "com.commercetools.sdk:commercetools-sdk-java-api:${commercetoolsJavaSDK2Version}"
49-
46+
implementation "com.commercetools.sdk:commercetools-http-client:${commercetoolsJavaSdkV2Version}"
47+
implementation "com.commercetools.sdk:commercetools-sdk-java-api:${commercetoolsJavaSdkV2Version}"
5048
implementation "com.github.ben-manes.caffeine:caffeine:${caffeineVersion}"
5149
implementation "org.apache.commons:commons-text:${commonTextVersion}"
52-
api "com.commercetools.sdk:commercetools-sdk-compat-v1:${commercetoolsJavaSdkV2Version}"
53-
api "com.commercetools.sdk:commercetools-apachehttp-client:${commercetoolsJavaSdkV2Version}"
50+
api 'commons-io:commons-io:2.11.0'
51+
api 'commons-codec:commons-codec:1.16.0'
52+
api 'com.google.code.findbugs:annotations:3.0.1'
53+
api 'com.neovisionaries:nv-i18n:1.28'
5454
testImplementation "org.mockito:mockito-junit-jupiter:${mockitoJunitJupiterVersion}"
5555
testImplementation "org.junit.jupiter:junit-jupiter-api:${jupiterApiVersion}"
5656
testImplementation "org.junit.jupiter:junit-jupiter-params:${jupiterApiVersion}"

src/integration-test/java/com/commercetools/sync/integration/commons/utils/ChannelITUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private static Channel createChannelIfNotAlreadyExisting(
9494
/**
9595
* Tries to fetch channel of key {@code channelKey} using {@code ctpClient}.
9696
*
97-
* @param ctpClient sphere client used to execute requests
97+
* @param ctpClient client used to execute requests
9898
* @param channelKey key of requested channel
9999
* @return {@link java.util.Optional} which may contain channel of key {@code channelKey}
100100
*/

src/integration-test/java/com/commercetools/sync/integration/commons/utils/InventoryITUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public static CustomFieldsDraft getMockCustomFieldsDraft() {
196196
* Tries to fetch inventory entry of {@code sku} and {@code supplyChannel} using {@code
197197
* ctpClient}.
198198
*
199-
* @param ctpClient sphere client used to execute requests
199+
* @param ctpClient client used to execute requests
200200
* @param sku sku of requested inventory entry
201201
* @param supplyChannel optional reference to supply channel of requested inventory entry
202202
* @param expand

src/integration-test/java/com/commercetools/sync/integration/commons/utils/ProductTypeITUtils.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,9 @@ public static ProductType ensureProductType(
369369
}
370370

371371
/**
372-
* Builds a list of two field definitions; one for a {@link
373-
* io.sphere.sdk.products.attributes.LocalizedStringAttributeType} and one for a {@link
374-
* io.sphere.sdk.products.attributes.BooleanAttributeType}. The JSON of the created attribute
375-
* definition list looks as follows:
372+
* Builds a list of two field definitions; one for a {@link AttributeLocalizableTextType} and one
373+
* for a {@link AttributeBooleanType}. The JSON of the created attribute definition list looks as
374+
* follows:
376375
*
377376
* <p>"attributes": [ { "name": "backgroundColor", "label": { "en": "backgroundColor" }, "type": {
378377
* "name": "LocalizedString" }, "inputHint": "SingleLine" }, { "name": "invisibleInShop", "label":
@@ -420,7 +419,7 @@ private static boolean productTypeExists(
420419
/**
421420
* Tries to fetch product type of {@code key} using {@code cptClient}.
422421
*
423-
* @param cptClient sphere client used to execute requests.
422+
* @param cptClient client used to execute requests.
424423
* @param key key of requested product type.
425424
* @return {@link java.util.Optional} which may contain product type of {@code key}.
426425
*/

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@
3131
import java.util.Locale;
3232
import java.util.concurrent.CompletableFuture;
3333
import java.util.concurrent.CompletionException;
34-
import org.junit.jupiter.api.AfterAll;
35-
import org.junit.jupiter.api.BeforeAll;
36-
import org.junit.jupiter.api.BeforeEach;
37-
import org.junit.jupiter.api.Test;
34+
import org.junit.jupiter.api.*;
3835

3936
class CategorySyncIT {
4037
private CategorySync categorySync;

src/integration-test/java/com/commercetools/sync/integration/ctpprojectsource/products/ProductSyncWithUnexpandedReferencesIT.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
import com.commercetools.sync.products.ProductSyncOptionsBuilder;
6464
import com.commercetools.sync.products.helpers.ProductSyncStatistics;
6565
import com.commercetools.sync.products.utils.ProductTransformUtils;
66-
import io.sphere.sdk.products.queries.ProductProjectionQuery;
6766
import io.vrap.rmf.base.client.ApiHttpResponse;
6867
import java.math.BigDecimal;
6968
import java.util.ArrayList;
@@ -79,7 +78,6 @@ class ProductSyncWithUnexpandedReferencesIT {
7978

8079
private static final String RESOURCE_KEY = "foo";
8180
private static final String TYPE_KEY = "typeKey";
82-
private static ProductProjectionQuery productQuery;
8381

8482
private ProductSync productSync;
8583
private List<String> errorCallBackMessages;
@@ -275,7 +273,6 @@ static void setupSourceProjectData() {
275273
.build();
276274

277275
CTP_SOURCE_CLIENT.products().create(productDraft).executeBlocking();
278-
productQuery = ProductProjectionQuery.ofStaged();
279276
}
280277

281278
@BeforeEach

src/integration-test/java/com/commercetools/sync/integration/services/impl/CartDiscountServiceImplIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void fetchMatchingCartDiscountsByKeys_WithAnyExistingKeys_ShouldReturnASetOfCart
149149

150150
@Test
151151
void fetchMatchingCartDiscountsByKeys_WithBadGateWayExceptionAlways_ShouldFail() {
152-
// Mock sphere client to return BadGatewayException on any request.
152+
// Mock client to return BadGatewayException on any request.
153153
final ProjectApiRoot spyClient = spy(CTP_TARGET_CLIENT);
154154
final ByProjectKeyCartDiscountsRequestBuilder byProjectKeyCartDiscountsRequestBuilder = mock();
155155
when(spyClient.cartDiscounts()).thenReturn(byProjectKeyCartDiscountsRequestBuilder);

src/integration-test/java/com/commercetools/sync/integration/services/impl/CategoryServiceImplIT.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ void fetchMatchingCategoriesByKeys_WithAllExistingSetOfKeys_ShouldReturnSetOfCat
198198

199199
@Test
200200
void fetchMatchingCategoriesByKeys_WithBadGateWayExceptionAlways_ShouldFail() {
201-
// Mock sphere client to return BadGatewayException on any request.
201+
// Mock client to return BadGatewayException on any request.
202202

203203
final ProjectApiRoot spyClient = spy(CTP_TARGET_CLIENT);
204204
when(spyClient.categories()).thenReturn(mock(ByProjectKeyCategoriesRequestBuilder.class));
@@ -547,10 +547,10 @@ void updateCategory_WithInvalidChanges_ShouldNotUpdateCategory() {
547547
final List<DuplicateFieldError> fieldErrors =
548548
badRequestException.getErrorResponse().getErrors().stream()
549549
.map(
550-
sphereError -> {
551-
assertThat(sphereError.getCode())
550+
error -> {
551+
assertThat(error.getCode())
552552
.isEqualTo(DuplicateFieldError.DUPLICATE_FIELD);
553-
return (DuplicateFieldError) sphereError;
553+
return (DuplicateFieldError) error;
554554
})
555555
.collect(toList());
556556
assertThat(fieldErrors).hasSize(1);
@@ -602,7 +602,7 @@ void fetchCategory_WithNullKey_ShouldNotFetchCategory() {
602602

603603
@Test
604604
void fetchCategory_WithBadGateWayExceptionAlways_ShouldFail() {
605-
// Mock sphere client to return BadGatewayException on any request.
605+
// Mock client to return BadGatewayException on any request.
606606
final ProjectApiRoot spyClient = spy(CTP_TARGET_CLIENT);
607607
when(spyClient.categories()).thenReturn(mock(ByProjectKeyCategoriesRequestBuilder.class));
608608

src/integration-test/java/com/commercetools/sync/integration/services/impl/CustomObjectServiceImplIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ void fetchMatchingCustomObjects_WithNonExistingKeysAndContainers_ShouldReturnEmp
213213

214214
@Test
215215
void fetchMatchingCustomObjectsByCompositeIdentifiers_WithBadGateWayExceptionAlways_ShouldFail() {
216-
// Mock sphere client to return BadGatewayException on any request.
216+
// Mock client to return BadGatewayException on any request.
217217
final ProjectApiRoot spyClient = Mockito.spy(TestClientUtils.CTP_TARGET_CLIENT);
218218
when(spyClient.customObjects()).thenReturn(mock(ByProjectKeyCustomObjectsRequestBuilder.class));
219219
final ByProjectKeyCustomObjectsGet getMock = mock(ByProjectKeyCustomObjectsGet.class);

src/integration-test/java/com/commercetools/sync/integration/services/impl/ProductTypeServiceImplIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ void fetchMatchingProductTypesByKeys_WithAnyExistingKeys_ShouldReturnASetOfProdu
180180

181181
@Test
182182
void fetchMatchingProductTypesByKeys_WithBadGateWayExceptionAlways_ShouldFail() {
183-
// Mock sphere client to return BadGatewayException on any request.
183+
// Mock client to return BadGatewayException on any request.
184184

185185
final ProjectApiRoot spyClient = spy(CTP_TARGET_CLIENT);
186186
when(spyClient.productTypes()).thenReturn(mock(ByProjectKeyProductTypesRequestBuilder.class));

0 commit comments

Comments
 (0)