Search in sources :

Example 71 with SyncException

use of com.commercetools.sync.commons.exceptions.SyncException in project commercetools-sync-java by commercetools.

the class CustomUpdateActionUtilsTest method buildNonNullCustomFieldsUpdateActions_WithNullNewCategoryTypeId_ShouldBuildUpdateActions.

@Test
void buildNonNullCustomFieldsUpdateActions_WithNullNewCategoryTypeId_ShouldBuildUpdateActions() throws BuildUpdateActionException {
    // Mock old CustomFields
    final CustomFields oldCustomFieldsMock = mock(CustomFields.class);
    when(oldCustomFieldsMock.getType()).thenReturn(Type.referenceOfId("1"));
    // Mock new CustomFieldsDraft
    final CustomFieldsDraft newCustomFieldsMock = mock(CustomFieldsDraft.class);
    when(newCustomFieldsMock.getType()).thenReturn(Type.referenceOfId(null));
    // Mock custom options error callback
    final ArrayList<String> errorMessages = new ArrayList<>();
    final QuadConsumer<SyncException, Optional<ProductDraft>, Optional<ProductProjection>, List<UpdateAction<Product>>> errorCallback = (exception, newResource, oldResource, updateActions) -> errorMessages.add(exception.getMessage());
    // Mock sync options
    final ProductSyncOptions productSyncOptions = ProductSyncOptionsBuilder.of(CTP_CLIENT).errorCallback(errorCallback).build();
    final Price price = mock(Price.class);
    when(price.getId()).thenReturn(UUID.randomUUID().toString());
    final List<UpdateAction<Product>> updateActions = buildNonNullCustomFieldsUpdateActions(oldCustomFieldsMock, newCustomFieldsMock, price, new PriceCustomActionBuilder(), 1, Price::getId, priceResource -> Price.resourceTypeId(), Price::getId, productSyncOptions);
    assertThat(errorMessages).hasSize(1);
    assertThat(errorMessages.get(0)).isEqualTo(format("Failed to build 'setCustomType' update action on the " + "%s with id '%s'. Reason: New Custom Type id is blank (null/empty).", Price.resourceTypeId(), price.getId()));
    assertThat(updateActions).isEmpty();
}
Also used : CustomUpdateActionUtils.buildCustomUpdateActions(com.commercetools.sync.commons.utils.CustomUpdateActionUtils.buildCustomUpdateActions) SetProductPriceCustomType(io.sphere.sdk.products.commands.updateactions.SetProductPriceCustomType) AssetCustomActionBuilder(com.commercetools.sync.products.helpers.AssetCustomActionBuilder) Reference(io.sphere.sdk.models.Reference) SyncException(com.commercetools.sync.commons.exceptions.SyncException) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) UpdateAction(io.sphere.sdk.commands.UpdateAction) Map(java.util.Map) CategoryCustomActionBuilder(com.commercetools.sync.categories.helpers.CategoryCustomActionBuilder) SphereClient(io.sphere.sdk.client.SphereClient) JsonNode(com.fasterxml.jackson.databind.JsonNode) ProductDraft(io.sphere.sdk.products.ProductDraft) ProductProjection(io.sphere.sdk.products.ProductProjection) AssetDraft(io.sphere.sdk.models.AssetDraft) AssetDraftBuilder(io.sphere.sdk.models.AssetDraftBuilder) Collections.emptyList(java.util.Collections.emptyList) Category(io.sphere.sdk.categories.Category) Price(io.sphere.sdk.products.Price) CustomFieldsDraft.ofTypeKeyAndJson(io.sphere.sdk.types.CustomFieldsDraft.ofTypeKeyAndJson) Product(io.sphere.sdk.products.Product) UUID(java.util.UUID) String.format(java.lang.String.format) Test(org.junit.jupiter.api.Test) List(java.util.List) LocalizedString.ofEnglish(io.sphere.sdk.models.LocalizedString.ofEnglish) ProductSyncOptionsBuilder(com.commercetools.sync.products.ProductSyncOptionsBuilder) JsonNodeFactory(com.fasterxml.jackson.databind.node.JsonNodeFactory) Optional(java.util.Optional) BuildUpdateActionException(com.commercetools.sync.commons.exceptions.BuildUpdateActionException) ProductSyncOptions(com.commercetools.sync.products.ProductSyncOptions) Mockito.mock(org.mockito.Mockito.mock) ResourceIdentifier(io.sphere.sdk.models.ResourceIdentifier) CustomFields(io.sphere.sdk.types.CustomFields) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) CustomUpdateActionUtils.buildNonNullCustomFieldsUpdateActions(com.commercetools.sync.commons.utils.CustomUpdateActionUtils.buildNonNullCustomFieldsUpdateActions) SetAssetCustomField(io.sphere.sdk.products.commands.updateactions.SetAssetCustomField) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) SetAssetCustomType(io.sphere.sdk.products.commands.updateactions.SetAssetCustomType) CustomUpdateActionUtils.buildSetCustomFieldsUpdateActions(com.commercetools.sync.commons.utils.CustomUpdateActionUtils.buildSetCustomFieldsUpdateActions) Mockito.when(org.mockito.Mockito.when) CategorySyncOptionsBuilder(com.commercetools.sync.categories.CategorySyncOptionsBuilder) Resource(io.sphere.sdk.models.Resource) CategorySyncOptions(com.commercetools.sync.categories.CategorySyncOptions) CustomFieldsDraft(io.sphere.sdk.types.CustomFieldsDraft) PriceCustomActionBuilder(com.commercetools.sync.products.helpers.PriceCustomActionBuilder) SetProductPriceCustomField(io.sphere.sdk.products.commands.updateactions.SetProductPriceCustomField) Asset(io.sphere.sdk.models.Asset) Type(io.sphere.sdk.types.Type) Optional(java.util.Optional) UpdateAction(io.sphere.sdk.commands.UpdateAction) PriceCustomActionBuilder(com.commercetools.sync.products.helpers.PriceCustomActionBuilder) ArrayList(java.util.ArrayList) Product(io.sphere.sdk.products.Product) SyncException(com.commercetools.sync.commons.exceptions.SyncException) CustomFields(io.sphere.sdk.types.CustomFields) Price(io.sphere.sdk.products.Price) Collections.emptyList(java.util.Collections.emptyList) List(java.util.List) ArrayList(java.util.ArrayList) ProductSyncOptions(com.commercetools.sync.products.ProductSyncOptions) CustomFieldsDraft(io.sphere.sdk.types.CustomFieldsDraft) Test(org.junit.jupiter.api.Test)

Example 72 with SyncException

use of com.commercetools.sync.commons.exceptions.SyncException in project commercetools-sync-java by commercetools.

the class CustomUpdateActionUtilsTest method buildNonNullCustomFieldsUpdateActions_WithBothNullCustomFields_ShouldNotBuildUpdateActions.

@Test
void buildNonNullCustomFieldsUpdateActions_WithBothNullCustomFields_ShouldNotBuildUpdateActions() {
    final Asset oldAsset = mock(Asset.class);
    when(oldAsset.getCustom()).thenReturn(null);
    final AssetDraft newAssetDraft = mock(AssetDraft.class);
    when(newAssetDraft.getCustom()).thenReturn(null);
    // Mock custom options error callback
    final ArrayList<Object> callBackResponses = new ArrayList<>();
    final QuadConsumer<SyncException, Optional<ProductDraft>, Optional<ProductProjection>, List<UpdateAction<Product>>> errorCallback = (exception, newResource, oldResource, updateActions) -> {
        callBackResponses.add(exception.getMessage());
        callBackResponses.add(exception.getCause());
    };
    // Mock sync options
    final ProductSyncOptions productSyncOptions = ProductSyncOptionsBuilder.of(CTP_CLIENT).errorCallback(errorCallback).build();
    final List<UpdateAction<Product>> updateActions = buildCustomUpdateActions(maiNewResource, oldAsset, newAssetDraft, new AssetCustomActionBuilder(), 10, Asset::getId, asset -> Asset.resourceTypeId(), Asset::getKey, productSyncOptions);
    assertThat(updateActions).isNotNull();
    assertThat(updateActions).isEmpty();
    assertThat(callBackResponses).isEmpty();
}
Also used : CustomUpdateActionUtils.buildCustomUpdateActions(com.commercetools.sync.commons.utils.CustomUpdateActionUtils.buildCustomUpdateActions) SetProductPriceCustomType(io.sphere.sdk.products.commands.updateactions.SetProductPriceCustomType) AssetCustomActionBuilder(com.commercetools.sync.products.helpers.AssetCustomActionBuilder) Reference(io.sphere.sdk.models.Reference) SyncException(com.commercetools.sync.commons.exceptions.SyncException) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) UpdateAction(io.sphere.sdk.commands.UpdateAction) Map(java.util.Map) CategoryCustomActionBuilder(com.commercetools.sync.categories.helpers.CategoryCustomActionBuilder) SphereClient(io.sphere.sdk.client.SphereClient) JsonNode(com.fasterxml.jackson.databind.JsonNode) ProductDraft(io.sphere.sdk.products.ProductDraft) ProductProjection(io.sphere.sdk.products.ProductProjection) AssetDraft(io.sphere.sdk.models.AssetDraft) AssetDraftBuilder(io.sphere.sdk.models.AssetDraftBuilder) Collections.emptyList(java.util.Collections.emptyList) Category(io.sphere.sdk.categories.Category) Price(io.sphere.sdk.products.Price) CustomFieldsDraft.ofTypeKeyAndJson(io.sphere.sdk.types.CustomFieldsDraft.ofTypeKeyAndJson) Product(io.sphere.sdk.products.Product) UUID(java.util.UUID) String.format(java.lang.String.format) Test(org.junit.jupiter.api.Test) List(java.util.List) LocalizedString.ofEnglish(io.sphere.sdk.models.LocalizedString.ofEnglish) ProductSyncOptionsBuilder(com.commercetools.sync.products.ProductSyncOptionsBuilder) JsonNodeFactory(com.fasterxml.jackson.databind.node.JsonNodeFactory) Optional(java.util.Optional) BuildUpdateActionException(com.commercetools.sync.commons.exceptions.BuildUpdateActionException) ProductSyncOptions(com.commercetools.sync.products.ProductSyncOptions) Mockito.mock(org.mockito.Mockito.mock) ResourceIdentifier(io.sphere.sdk.models.ResourceIdentifier) CustomFields(io.sphere.sdk.types.CustomFields) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) CustomUpdateActionUtils.buildNonNullCustomFieldsUpdateActions(com.commercetools.sync.commons.utils.CustomUpdateActionUtils.buildNonNullCustomFieldsUpdateActions) SetAssetCustomField(io.sphere.sdk.products.commands.updateactions.SetAssetCustomField) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) SetAssetCustomType(io.sphere.sdk.products.commands.updateactions.SetAssetCustomType) CustomUpdateActionUtils.buildSetCustomFieldsUpdateActions(com.commercetools.sync.commons.utils.CustomUpdateActionUtils.buildSetCustomFieldsUpdateActions) Mockito.when(org.mockito.Mockito.when) CategorySyncOptionsBuilder(com.commercetools.sync.categories.CategorySyncOptionsBuilder) Resource(io.sphere.sdk.models.Resource) CategorySyncOptions(com.commercetools.sync.categories.CategorySyncOptions) CustomFieldsDraft(io.sphere.sdk.types.CustomFieldsDraft) PriceCustomActionBuilder(com.commercetools.sync.products.helpers.PriceCustomActionBuilder) SetProductPriceCustomField(io.sphere.sdk.products.commands.updateactions.SetProductPriceCustomField) Asset(io.sphere.sdk.models.Asset) Type(io.sphere.sdk.types.Type) Optional(java.util.Optional) UpdateAction(io.sphere.sdk.commands.UpdateAction) ArrayList(java.util.ArrayList) AssetCustomActionBuilder(com.commercetools.sync.products.helpers.AssetCustomActionBuilder) Product(io.sphere.sdk.products.Product) SyncException(com.commercetools.sync.commons.exceptions.SyncException) AssetDraft(io.sphere.sdk.models.AssetDraft) Asset(io.sphere.sdk.models.Asset) Collections.emptyList(java.util.Collections.emptyList) List(java.util.List) ArrayList(java.util.ArrayList) ProductSyncOptions(com.commercetools.sync.products.ProductSyncOptions) Test(org.junit.jupiter.api.Test)

Example 73 with SyncException

use of com.commercetools.sync.commons.exceptions.SyncException in project commercetools-sync-java by commercetools.

the class GenericUpdateActionUtilsTest method buildTypedSetCustomTypeUpdateAction_WithNullNewIdCategoryAsset_ShouldNotBuildCategoryUpdateAction.

@Test
void buildTypedSetCustomTypeUpdateAction_WithNullNewIdCategoryAsset_ShouldNotBuildCategoryUpdateAction() {
    final ArrayList<String> errorMessages = new ArrayList<>();
    final QuadConsumer<SyncException, Optional<CategoryDraft>, Optional<Category>, List<UpdateAction<Category>>> errorCallback = (exception, oldResource, newResource, updateActions) -> errorMessages.add(exception.getMessage());
    // Mock sync options
    final CategorySyncOptions categorySyncOptions = of(mock(SphereClient.class)).errorCallback(errorCallback).build();
    final Optional<UpdateAction<Category>> updateAction = buildTypedSetCustomTypeUpdateAction(null, new HashMap<>(), mock(Asset.class), new AssetCustomActionBuilder(), 1, Asset::getId, assetResource -> Asset.resourceTypeId(), Asset::getKey, categorySyncOptions);
    assertThat(errorMessages).hasSize(1);
    assertThat(errorMessages.get(0)).isEqualTo("Failed to build 'setCustomType' update action on the asset with" + " id 'null'. Reason: New Custom Type id is blank (null/empty).");
    assertThat(updateAction).isEmpty();
}
Also used : AssetCustomActionBuilder(com.commercetools.sync.categories.helpers.AssetCustomActionBuilder) SyncException(com.commercetools.sync.commons.exceptions.SyncException) CategorySyncOptionsBuilder.of(com.commercetools.sync.categories.CategorySyncOptionsBuilder.of) Category(io.sphere.sdk.categories.Category) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) UpdateAction(io.sphere.sdk.commands.UpdateAction) HashMap(java.util.HashMap) GenericUpdateActionUtils.buildTypedSetCustomTypeUpdateAction(com.commercetools.sync.commons.utils.GenericUpdateActionUtils.buildTypedSetCustomTypeUpdateAction) CategoryDraft(io.sphere.sdk.categories.CategoryDraft) ArrayList(java.util.ArrayList) CategorySyncOptions(com.commercetools.sync.categories.CategorySyncOptions) Test(org.junit.jupiter.api.Test) List(java.util.List) SphereClient(io.sphere.sdk.client.SphereClient) Optional(java.util.Optional) Asset(io.sphere.sdk.models.Asset) Mockito.mock(org.mockito.Mockito.mock) Category(io.sphere.sdk.categories.Category) Optional(java.util.Optional) UpdateAction(io.sphere.sdk.commands.UpdateAction) GenericUpdateActionUtils.buildTypedSetCustomTypeUpdateAction(com.commercetools.sync.commons.utils.GenericUpdateActionUtils.buildTypedSetCustomTypeUpdateAction) ArrayList(java.util.ArrayList) AssetCustomActionBuilder(com.commercetools.sync.categories.helpers.AssetCustomActionBuilder) SyncException(com.commercetools.sync.commons.exceptions.SyncException) SphereClient(io.sphere.sdk.client.SphereClient) CategorySyncOptions(com.commercetools.sync.categories.CategorySyncOptions) Asset(io.sphere.sdk.models.Asset) ArrayList(java.util.ArrayList) List(java.util.List) Test(org.junit.jupiter.api.Test)

Example 74 with SyncException

use of com.commercetools.sync.commons.exceptions.SyncException in project commercetools-sync-java by commercetools.

the class ProductTypeBatchValidatorTest method validateAndCollectReferencedKeys_WithMixOfValidAndInvalidDrafts_ShouldValidateCorrectly.

@Test
void validateAndCollectReferencedKeys_WithMixOfValidAndInvalidDrafts_ShouldValidateCorrectly() {
    final AttributeDefinitionDraft attributeDefinitionDraft = AttributeDefinitionDraftBuilder.of(StringAttributeType.of(), "foo", ofEnglish("koko"), true).build();
    final AttributeDefinitionDraft nestedTypeAttrDefDraft = AttributeDefinitionDraftBuilder.of(NestedAttributeType.of(ProductType.referenceOfId("x")), "validNested", ofEnglish("koko"), true).build();
    final AttributeDefinitionDraft setOfNestedTypeAttrDefDraft = AttributeDefinitionDraftBuilder.of(SetAttributeType.of(NestedAttributeType.of(ProductType.referenceOfId("y"))), "setOfNested", ofEnglish("koko"), true).build();
    final AttributeDefinitionDraft invalidNestedTypeAttrDefDraft = AttributeDefinitionDraftBuilder.of(NestedAttributeType.of(ProductType.referenceOfId("")), "invalidNested", ofEnglish("koko"), true).build();
    final AttributeDefinitionDraft setOfInvalidNestedTypeAttrDefDraft = AttributeDefinitionDraftBuilder.of(SetAttributeType.of(NestedAttributeType.of(ProductType.referenceOfId(""))), "setOfInvalidNested", ofEnglish("koko"), true).build();
    final List<AttributeDefinitionDraft> attributes = new ArrayList<>();
    attributes.add(attributeDefinitionDraft);
    attributes.add(nestedTypeAttrDefDraft);
    attributes.add(setOfNestedTypeAttrDefDraft);
    attributes.add(invalidNestedTypeAttrDefDraft);
    attributes.add(setOfInvalidNestedTypeAttrDefDraft);
    final ProductTypeDraft productTypeDraft = ProductTypeDraftBuilder.of("foo", "foo", "foo", attributes).build();
    final ProductTypeDraft productTypeDraftWithEmptyKey = ProductTypeDraftBuilder.of("", "foo", "foo", attributes).build();
    final ProductTypeDraft validProductTypeDraftWithReferences = ProductTypeDraftBuilder.of("bar", "bar", "bar", asList(attributeDefinitionDraft, nestedTypeAttrDefDraft, setOfNestedTypeAttrDefDraft)).build();
    final ProductTypeDraft draftWithEmptyAttributes = ProductTypeDraftBuilder.of("bar", "bar", "bar", emptyList()).build();
    final ProductTypeDraft draftWithNullAttributes = ProductTypeDraftBuilder.of("bar", "bar", "bar", null).build();
    final List<ProductTypeDraft> productTypeDrafts = new ArrayList<>();
    productTypeDrafts.add(productTypeDraft);
    productTypeDrafts.add(null);
    productTypeDrafts.add(productTypeDraftWithEmptyKey);
    productTypeDrafts.add(validProductTypeDraftWithReferences);
    productTypeDrafts.add(draftWithEmptyAttributes);
    productTypeDrafts.add(draftWithNullAttributes);
    final ProductTypeBatchValidator batchValidator = new ProductTypeBatchValidator(syncOptions, syncStatistics);
    final ImmutablePair<Set<ProductTypeDraft>, Set<String>> pair = batchValidator.validateAndCollectReferencedKeys(productTypeDrafts);
    assertThat(pair.getLeft()).containsExactlyInAnyOrder(validProductTypeDraftWithReferences, draftWithEmptyAttributes, draftWithNullAttributes);
    assertThat(pair.getRight()).containsExactlyInAnyOrder("x", "y");
    final String expectedExceptionMessage = format(PRODUCT_TYPE_HAS_INVALID_REFERENCES, productTypeDraft.getKey(), "[invalidNested, setOfInvalidNested]");
    assertThat(errorCallBackMessages).containsExactlyInAnyOrderElementsOf(asList(expectedExceptionMessage, PRODUCT_TYPE_DRAFT_IS_NULL, format(PRODUCT_TYPE_DRAFT_KEY_NOT_SET, productTypeDraftWithEmptyKey.getName())));
    final Predicate<Throwable> invalidReferencePredicate = throwable -> expectedExceptionMessage.equals(throwable.getMessage()) && BLANK_ID_VALUE_ON_REFERENCE.equals(throwable.getCause().getMessage());
    final Condition<Throwable> invalidReferenceCondition = new Condition<>(invalidReferencePredicate, "ReferenceResolutionException: " + "ProductTypeDraft with Key 'foo' has invalid references on attributeDraft with name 'nested'.");
    final Predicate<Throwable> nullDraftPredicate = throwable -> PRODUCT_TYPE_DRAFT_IS_NULL.equals(throwable.getMessage()) && throwable instanceof SyncException;
    final Condition<Throwable> nullDraftCondition = new Condition<>(nullDraftPredicate, "SyncException: ProductTypeDraft is null.");
    final Predicate<Throwable> blankProductTypeKeyPredicate = throwable -> format(PRODUCT_TYPE_DRAFT_KEY_NOT_SET, productTypeDraftWithEmptyKey.getName()).equals(throwable.getMessage()) && throwable instanceof SyncException;
    final Condition<Throwable> blankKeyCondition = new Condition<>(blankProductTypeKeyPredicate, "SyncException: ProductTypeDraft has blank key.");
    assertThat(errorCallBackExceptions).hasSize(3).haveExactly(1, invalidReferenceCondition).haveExactly(1, nullDraftCondition).haveExactly(1, blankKeyCondition);
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) BLANK_ID_VALUE_ON_REFERENCE(com.commercetools.sync.commons.helpers.BaseReferenceResolver.BLANK_ID_VALUE_ON_REFERENCE) SyncException(com.commercetools.sync.commons.exceptions.SyncException) PRODUCT_TYPE_HAS_INVALID_REFERENCES(com.commercetools.sync.producttypes.helpers.ProductTypeBatchValidator.PRODUCT_TYPE_HAS_INVALID_REFERENCES) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) ProductType(io.sphere.sdk.producttypes.ProductType) Collections.singletonList(java.util.Collections.singletonList) ArrayList(java.util.ArrayList) ProductTypeSyncOptionsBuilder(com.commercetools.sync.producttypes.ProductTypeSyncOptionsBuilder) PRODUCT_TYPE_DRAFT_IS_NULL(com.commercetools.sync.producttypes.helpers.ProductTypeBatchValidator.PRODUCT_TYPE_DRAFT_IS_NULL) StringAttributeType(io.sphere.sdk.products.attributes.StringAttributeType) Arrays.asList(java.util.Arrays.asList) EMPTY(org.apache.commons.lang3.StringUtils.EMPTY) SphereClient(io.sphere.sdk.client.SphereClient) PRODUCT_TYPE_DRAFT_KEY_NOT_SET(com.commercetools.sync.producttypes.helpers.ProductTypeBatchValidator.PRODUCT_TYPE_DRAFT_KEY_NOT_SET) Nonnull(javax.annotation.Nonnull) SetAttributeType(io.sphere.sdk.products.attributes.SetAttributeType) AttributeDefinitionDraftBuilder(io.sphere.sdk.products.attributes.AttributeDefinitionDraftBuilder) ProductTypeDraftBuilder(io.sphere.sdk.producttypes.ProductTypeDraftBuilder) Collections.emptyList(java.util.Collections.emptyList) Predicate(java.util.function.Predicate) Set(java.util.Set) ProductTypeDraft(io.sphere.sdk.producttypes.ProductTypeDraft) Mockito.when(org.mockito.Mockito.when) InvalidReferenceException(com.commercetools.sync.commons.exceptions.InvalidReferenceException) String.format(java.lang.String.format) ProductTypeSyncOptions(com.commercetools.sync.producttypes.ProductTypeSyncOptions) ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair) Test(org.junit.jupiter.api.Test) NestedAttributeType(io.sphere.sdk.products.attributes.NestedAttributeType) List(java.util.List) LocalizedString.ofEnglish(io.sphere.sdk.models.LocalizedString.ofEnglish) Condition(org.assertj.core.api.Condition) Collections(java.util.Collections) AttributeDefinitionDraft(io.sphere.sdk.products.attributes.AttributeDefinitionDraft) Mockito.mock(org.mockito.Mockito.mock) Condition(org.assertj.core.api.Condition) Set(java.util.Set) ArrayList(java.util.ArrayList) AttributeDefinitionDraft(io.sphere.sdk.products.attributes.AttributeDefinitionDraft) SyncException(com.commercetools.sync.commons.exceptions.SyncException) ProductTypeDraft(io.sphere.sdk.producttypes.ProductTypeDraft) Test(org.junit.jupiter.api.Test)

Aggregations

SyncException (com.commercetools.sync.commons.exceptions.SyncException)74 Nonnull (javax.annotation.Nonnull)47 UpdateAction (io.sphere.sdk.commands.UpdateAction)45 Optional (java.util.Optional)39 List (java.util.List)37 CompletionStage (java.util.concurrent.CompletionStage)25 SphereClient (io.sphere.sdk.client.SphereClient)24 String.format (java.lang.String.format)23 ArrayList (java.util.ArrayList)21 Map (java.util.Map)20 Test (org.junit.jupiter.api.Test)20 TriConsumer (com.commercetools.sync.commons.utils.TriConsumer)18 Set (java.util.Set)17 CompletableFuture (java.util.concurrent.CompletableFuture)17 Nullable (javax.annotation.Nullable)16 ImmutablePair (org.apache.commons.lang3.tuple.ImmutablePair)14 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)14 Category (io.sphere.sdk.categories.Category)13 BaseSync (com.commercetools.sync.commons.BaseSync)12 QuadConsumer (com.commercetools.sync.commons.utils.QuadConsumer)12