Skip to content

Commit eb49e9f

Browse files
committed
#1201 reformat code
1 parent 20649ad commit eb49e9f

File tree

1 file changed

+36
-40
lines changed
  • src/integration-test/java/com/commercetools/sync/integration/externalsource/products

1 file changed

+36
-40
lines changed

src/integration-test/java/com/commercetools/sync/integration/externalsource/products/ProductSyncIT.java

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -961,59 +961,55 @@ void test_Generic_NPE_error_without_details_on_product_import() {
961961
// preparation
962962
final List<ProductUpdateAction> updateActions = new ArrayList<>();
963963
final TriConsumer<SyncException, Optional<ProductDraft>, Optional<ProductProjection>>
964-
warningCallBack =
964+
warningCallBack =
965965
(exception, newResource, oldResource) ->
966-
warningCallBackMessages.add(exception.getMessage());
966+
warningCallBackMessages.add(exception.getMessage());
967967

968968
final ProductSyncOptions customOptions =
969-
ProductSyncOptionsBuilder.of(TestClientUtils.CTP_TARGET_CLIENT)
970-
.errorCallback(
971-
(exception, oldResource, newResource, actions) ->
972-
collectErrors(exception.getMessage(), exception.getCause()))
973-
.warningCallback(warningCallBack)
974-
.beforeUpdateCallback(
975-
(actions, draft, old) -> {
976-
updateActions.addAll(actions);
977-
return actions;
978-
})
979-
.build();
969+
ProductSyncOptionsBuilder.of(TestClientUtils.CTP_TARGET_CLIENT)
970+
.errorCallback(
971+
(exception, oldResource, newResource, actions) ->
972+
collectErrors(exception.getMessage(), exception.getCause()))
973+
.warningCallback(warningCallBack)
974+
.beforeUpdateCallback(
975+
(actions, draft, old) -> {
976+
updateActions.addAll(actions);
977+
return actions;
978+
})
979+
.build();
980980

981981
final ProductDraft productDraft =
982-
createProductDraftBuilder(
983-
PRODUCT_KEY_1_RESOURCE_PATH,
984-
ProductTypeResourceIdentifierBuilder.of().key(productType.getKey()).build())
985-
.slug(LocalizedString.of(Locale.ENGLISH, "slug"))
986-
.categories(emptyList())
987-
.taxCategory((TaxCategoryResourceIdentifier) null)
988-
.state((StateResourceIdentifier) null)
989-
.build();
982+
createProductDraftBuilder(
983+
PRODUCT_KEY_1_RESOURCE_PATH,
984+
ProductTypeResourceIdentifierBuilder.of().key(productType.getKey()).build())
985+
.slug(LocalizedString.of(Locale.ENGLISH, "slug"))
986+
.categories(emptyList())
987+
.taxCategory((TaxCategoryResourceIdentifier) null)
988+
.state((StateResourceIdentifier) null)
989+
.build();
990990

991991
final ProductDraft productDraft2 =
992-
createProductDraftBuilder(
993-
PRODUCT_KEY_1_RESOURCE_PATH,
994-
ProductTypeResourceIdentifierBuilder.of().key(productType.getKey()).build())
995-
.key(UUID.randomUUID().toString())
996-
.slug(LocalizedString.of(Locale.ENGLISH, "slug"))
997-
.categories(emptyList())
998-
.taxCategory((TaxCategoryResourceIdentifier) null)
999-
.state((StateResourceIdentifier) null)
1000-
.build();
992+
createProductDraftBuilder(
993+
PRODUCT_KEY_1_RESOURCE_PATH,
994+
ProductTypeResourceIdentifierBuilder.of().key(productType.getKey()).build())
995+
.key(UUID.randomUUID().toString())
996+
.slug(LocalizedString.of(Locale.ENGLISH, "slug"))
997+
.categories(emptyList())
998+
.taxCategory((TaxCategoryResourceIdentifier) null)
999+
.state((StateResourceIdentifier) null)
1000+
.build();
10011001

10021002
// test
10031003
final ProductSync productSync = new ProductSync(customOptions);
1004-
productSync
1005-
.sync(singletonList(productDraft))
1006-
.toCompletableFuture()
1007-
.join();
1004+
productSync.sync(singletonList(productDraft)).toCompletableFuture().join();
10081005
final ProductSyncStatistics syncStatistics =
1009-
productSync
1010-
.sync(singletonList(productDraft2))
1011-
.toCompletableFuture()
1012-
.join();
1006+
productSync.sync(singletonList(productDraft2)).toCompletableFuture().join();
10131007

10141008
assertThat(syncStatistics).hasValues(2, 0, 1, 1, 0);
1015-
assertThat(this.errorCallBackExceptions.get(0).getCause().getMessage()).contains("A duplicate value '\\\"slug\\\"' exists for field");
1016-
assertThat(this.errorCallBackMessages.get(0)).contains("A duplicate value '\\\"slug\\\"' exists for field");
1009+
assertThat(this.errorCallBackExceptions.get(0).getCause().getMessage())
1010+
.contains("A duplicate value '\\\"slug\\\"' exists for field");
1011+
assertThat(this.errorCallBackMessages.get(0))
1012+
.contains("A duplicate value '\\\"slug\\\"' exists for field");
10171013
}
10181014

10191015
@Test

0 commit comments

Comments
 (0)