Search in sources :

Example 21 with ProductTypeService

use of com.commercetools.sync.services.ProductTypeService in project commercetools-sync-java by commercetools.

the class ProductTypeSyncTest method sync_WithErrorUpdatingProductType_ShouldCallErrorCallback.

@Test
@SuppressWarnings("unchecked")
void sync_WithErrorUpdatingProductType_ShouldCallErrorCallback() {
    String draftKey = "key2";
    // preparation
    final ProductTypeDraft newProductTypeDraft2 = ProductTypeDraft.ofAttributeDefinitionDrafts(draftKey, "name", "desc", emptyList());
    NestedAttributeType nestedTypeAttrDefDraft1 = NestedAttributeType.of(referenceOfId(draftKey));
    final AttributeDefinitionDraft nestedTypeAttrDefDraft = AttributeDefinitionDraftBuilder.of(nestedTypeAttrDefDraft1, "validNested", ofEnglish("koko"), true).build();
    final ProductTypeDraft newProductTypeDraft1 = ProductTypeDraft.ofAttributeDefinitionDrafts("key1", "name", "desc", singletonList(nestedTypeAttrDefDraft));
    final List<String> errorMessages = new ArrayList<>();
    final List<Throwable> exceptions = new ArrayList<>();
    final ProductTypeSyncOptions syncOptions = ProductTypeSyncOptionsBuilder.of(mock(SphereClient.class)).errorCallback((exception, oldResource, newResource, actions) -> {
        errorMessages.add(exception.getMessage());
        exceptions.add(exception);
    }).build();
    final ProductTypeService mockProductTypeService = mock(ProductTypeServiceImpl.class);
    final ProductType existingProductType = mock(ProductType.class);
    when(existingProductType.getKey()).thenReturn(newProductTypeDraft1.getKey());
    when(mockProductTypeService.fetchMatchingProductTypesByKeys(newLinkedHashSet(newProductTypeDraft2.getKey(), newProductTypeDraft1.getKey()))).thenReturn(CompletableFuture.completedFuture(Collections.emptySet()), CompletableFuture.completedFuture(singleton(existingProductType)));
    when(mockProductTypeService.fetchMatchingProductTypesByKeys(newLinkedHashSet(newProductTypeDraft1.getKey()))).thenReturn(CompletableFuture.completedFuture(singleton(existingProductType)));
    when(mockProductTypeService.fetchMatchingProductTypesByKeys(emptySet())).thenReturn(CompletableFuture.completedFuture(Collections.emptySet()));
    when(mockProductTypeService.updateProductType(any(), any())).thenReturn(supplyAsync(() -> {
        throw new SphereException();
    }));
    when(mockProductTypeService.cacheKeysToIds(anySet())).thenReturn(CompletableFuture.completedFuture(emptyMap()));
    when(mockProductTypeService.createProductType(any())).thenReturn(CompletableFuture.completedFuture(Optional.of(existingProductType)));
    when(mockProductTypeService.fetchCachedProductTypeId(any())).thenReturn(CompletableFuture.completedFuture(Optional.of("key1")));
    // test
    final ProductTypeSync productTypeSync = new ProductTypeSync(syncOptions, mockProductTypeService);
    productTypeSync.sync(list(newProductTypeDraft2, newProductTypeDraft1)).toCompletableFuture().join();
    // assertions
    assertThat(errorMessages.get(0)).contains("Failed to update product type with key: 'key1'. Reason: io.sphere.sdk.models.SphereException:");
}
Also used : Reference(io.sphere.sdk.models.Reference) SyncException(com.commercetools.sync.commons.exceptions.SyncException) CompletableFuture.completedFuture(java.util.concurrent.CompletableFuture.completedFuture) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) UpdateAction(io.sphere.sdk.commands.UpdateAction) ProductTypeCreateCommand(io.sphere.sdk.producttypes.commands.ProductTypeCreateCommand) Collections.singletonList(java.util.Collections.singletonList) Collections.singleton(java.util.Collections.singleton) ProductTypeService(com.commercetools.sync.services.ProductTypeService) THROWABLE(org.assertj.core.api.InstanceOfAssertFactories.THROWABLE) SphereClient(io.sphere.sdk.client.SphereClient) ProductTypeQuery(io.sphere.sdk.producttypes.queries.ProductTypeQuery) ProductTypeUpdateCommand(io.sphere.sdk.producttypes.commands.ProductTypeUpdateCommand) ProductTypeDraftBuilder(io.sphere.sdk.producttypes.ProductTypeDraftBuilder) ResourceKeyIdGraphQlRequest(com.commercetools.sync.commons.helpers.ResourceKeyIdGraphQlRequest) Collections.emptyList(java.util.Collections.emptyList) CompletionException(java.util.concurrent.CompletionException) UUID(java.util.UUID) Test(org.junit.jupiter.api.Test) List(java.util.List) LocalizedString.ofEnglish(io.sphere.sdk.models.LocalizedString.ofEnglish) ProductTypeServiceImpl(com.commercetools.sync.services.impl.ProductTypeServiceImpl) Sets.newLinkedHashSet(org.assertj.core.util.Sets.newLinkedHashSet) Optional(java.util.Optional) AttributeDefinitionDraft(io.sphere.sdk.products.attributes.AttributeDefinitionDraft) Mockito.mock(org.mockito.Mockito.mock) ProductTypeSyncStatistics(com.commercetools.sync.producttypes.helpers.ProductTypeSyncStatistics) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) ArgumentMatchers.anySet(org.mockito.ArgumentMatchers.anySet) ProductType(io.sphere.sdk.producttypes.ProductType) AssertionsForStatistics.assertThat(com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics.assertThat) CompletableFuture(java.util.concurrent.CompletableFuture) Mockito.spy(org.mockito.Mockito.spy) ArrayList(java.util.ArrayList) Assertions.as(org.assertj.core.api.Assertions.as) CompletableFuture.supplyAsync(java.util.concurrent.CompletableFuture.supplyAsync) SphereException(io.sphere.sdk.models.SphereException) ChangeDescription(io.sphere.sdk.producttypes.commands.updateactions.ChangeDescription) Collections.emptyMap(java.util.Collections.emptyMap) AttributeDefinitionDraftBuilder(io.sphere.sdk.products.attributes.AttributeDefinitionDraftBuilder) Collections.emptySet(java.util.Collections.emptySet) ProductType.referenceOfId(io.sphere.sdk.producttypes.ProductType.referenceOfId) ProductTypeDraft(io.sphere.sdk.producttypes.ProductTypeDraft) Lists.list(org.assertj.core.util.Lists.list) Mockito.when(org.mockito.Mockito.when) ChangeName(io.sphere.sdk.producttypes.commands.updateactions.ChangeName) Mockito.verify(org.mockito.Mockito.verify) Mockito.never(org.mockito.Mockito.never) NestedAttributeType(io.sphere.sdk.products.attributes.NestedAttributeType) PagedQueryResult(io.sphere.sdk.queries.PagedQueryResult) STRING(org.assertj.core.api.InstanceOfAssertFactories.STRING) Collections(java.util.Collections) ArrayList(java.util.ArrayList) ProductType(io.sphere.sdk.producttypes.ProductType) AttributeDefinitionDraft(io.sphere.sdk.products.attributes.AttributeDefinitionDraft) NestedAttributeType(io.sphere.sdk.products.attributes.NestedAttributeType) SphereException(io.sphere.sdk.models.SphereException) ProductTypeDraft(io.sphere.sdk.producttypes.ProductTypeDraft) ProductTypeService(com.commercetools.sync.services.ProductTypeService) SphereClient(io.sphere.sdk.client.SphereClient) Test(org.junit.jupiter.api.Test)

Example 22 with ProductTypeService

use of com.commercetools.sync.services.ProductTypeService in project commercetools-sync-java by commercetools.

the class ProductTypeSyncTest method sync_WithNullAttributeDefinitions_ShouldSyncCorrectly.

@Test
void sync_WithNullAttributeDefinitions_ShouldSyncCorrectly() {
    // preparation
    final ProductTypeDraft newProductTypeDraft = ProductTypeDraft.ofAttributeDefinitionDrafts("foo", "name", "desc", null);
    final List<String> errorMessages = new ArrayList<>();
    final List<Throwable> exceptions = new ArrayList<>();
    final List<UpdateAction> actions = new ArrayList<>();
    final ProductTypeSyncOptions syncOptions = ProductTypeSyncOptionsBuilder.of(mock(SphereClient.class)).beforeUpdateCallback((generatedActions, draft, productType) -> {
        actions.addAll(generatedActions);
        return generatedActions;
    }).errorCallback((exception, oldResource, newResource, updateActions) -> {
        errorMessages.add(exception.getMessage());
        exceptions.add(exception);
    }).build();
    final ProductTypeService mockProductTypeService = mock(ProductTypeServiceImpl.class);
    final ProductType existingProductType = mock(ProductType.class);
    when(existingProductType.getKey()).thenReturn(newProductTypeDraft.getKey());
    when(mockProductTypeService.fetchMatchingProductTypesByKeys(singleton(newProductTypeDraft.getKey()))).thenReturn(CompletableFuture.completedFuture(singleton(existingProductType)));
    when(mockProductTypeService.fetchMatchingProductTypesByKeys(emptySet())).thenReturn(CompletableFuture.completedFuture(Collections.emptySet()));
    when(mockProductTypeService.updateProductType(any(), any())).thenReturn(CompletableFuture.completedFuture(existingProductType));
    when(mockProductTypeService.cacheKeysToIds(anySet())).thenReturn(CompletableFuture.completedFuture(emptyMap()));
    final ProductTypeSync productTypeSync = new ProductTypeSync(syncOptions, mockProductTypeService);
    // test
    final ProductTypeSyncStatistics productTypeSyncStatistics = productTypeSync.sync(singletonList(newProductTypeDraft)).toCompletableFuture().join();
    // assertions
    assertThat(errorMessages).isEmpty();
    assertThat(exceptions).isEmpty();
    assertThat(actions).containsExactly(ChangeName.of(newProductTypeDraft.getName()), ChangeDescription.of(newProductTypeDraft.getDescription()));
    assertThat(productTypeSyncStatistics).hasValues(1, 0, 1, 0, 0);
}
Also used : Reference(io.sphere.sdk.models.Reference) SyncException(com.commercetools.sync.commons.exceptions.SyncException) CompletableFuture.completedFuture(java.util.concurrent.CompletableFuture.completedFuture) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) UpdateAction(io.sphere.sdk.commands.UpdateAction) ProductTypeCreateCommand(io.sphere.sdk.producttypes.commands.ProductTypeCreateCommand) Collections.singletonList(java.util.Collections.singletonList) Collections.singleton(java.util.Collections.singleton) ProductTypeService(com.commercetools.sync.services.ProductTypeService) THROWABLE(org.assertj.core.api.InstanceOfAssertFactories.THROWABLE) SphereClient(io.sphere.sdk.client.SphereClient) ProductTypeQuery(io.sphere.sdk.producttypes.queries.ProductTypeQuery) ProductTypeUpdateCommand(io.sphere.sdk.producttypes.commands.ProductTypeUpdateCommand) ProductTypeDraftBuilder(io.sphere.sdk.producttypes.ProductTypeDraftBuilder) ResourceKeyIdGraphQlRequest(com.commercetools.sync.commons.helpers.ResourceKeyIdGraphQlRequest) Collections.emptyList(java.util.Collections.emptyList) CompletionException(java.util.concurrent.CompletionException) UUID(java.util.UUID) Test(org.junit.jupiter.api.Test) List(java.util.List) LocalizedString.ofEnglish(io.sphere.sdk.models.LocalizedString.ofEnglish) ProductTypeServiceImpl(com.commercetools.sync.services.impl.ProductTypeServiceImpl) Sets.newLinkedHashSet(org.assertj.core.util.Sets.newLinkedHashSet) Optional(java.util.Optional) AttributeDefinitionDraft(io.sphere.sdk.products.attributes.AttributeDefinitionDraft) Mockito.mock(org.mockito.Mockito.mock) ProductTypeSyncStatistics(com.commercetools.sync.producttypes.helpers.ProductTypeSyncStatistics) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) ArgumentMatchers.anySet(org.mockito.ArgumentMatchers.anySet) ProductType(io.sphere.sdk.producttypes.ProductType) AssertionsForStatistics.assertThat(com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics.assertThat) CompletableFuture(java.util.concurrent.CompletableFuture) Mockito.spy(org.mockito.Mockito.spy) ArrayList(java.util.ArrayList) Assertions.as(org.assertj.core.api.Assertions.as) CompletableFuture.supplyAsync(java.util.concurrent.CompletableFuture.supplyAsync) SphereException(io.sphere.sdk.models.SphereException) ChangeDescription(io.sphere.sdk.producttypes.commands.updateactions.ChangeDescription) Collections.emptyMap(java.util.Collections.emptyMap) AttributeDefinitionDraftBuilder(io.sphere.sdk.products.attributes.AttributeDefinitionDraftBuilder) Collections.emptySet(java.util.Collections.emptySet) ProductType.referenceOfId(io.sphere.sdk.producttypes.ProductType.referenceOfId) ProductTypeDraft(io.sphere.sdk.producttypes.ProductTypeDraft) Lists.list(org.assertj.core.util.Lists.list) Mockito.when(org.mockito.Mockito.when) ChangeName(io.sphere.sdk.producttypes.commands.updateactions.ChangeName) Mockito.verify(org.mockito.Mockito.verify) Mockito.never(org.mockito.Mockito.never) NestedAttributeType(io.sphere.sdk.products.attributes.NestedAttributeType) PagedQueryResult(io.sphere.sdk.queries.PagedQueryResult) STRING(org.assertj.core.api.InstanceOfAssertFactories.STRING) Collections(java.util.Collections) UpdateAction(io.sphere.sdk.commands.UpdateAction) ArrayList(java.util.ArrayList) ProductType(io.sphere.sdk.producttypes.ProductType) ProductTypeSyncStatistics(com.commercetools.sync.producttypes.helpers.ProductTypeSyncStatistics) ProductTypeDraft(io.sphere.sdk.producttypes.ProductTypeDraft) ProductTypeService(com.commercetools.sync.services.ProductTypeService) Test(org.junit.jupiter.api.Test)

Example 23 with ProductTypeService

use of com.commercetools.sync.services.ProductTypeService in project commercetools-sync-java by commercetools.

the class ProductTypeSyncTest method sync_WithEmptyAttributeDefinitions_ShouldSyncCorrectly.

@Test
void sync_WithEmptyAttributeDefinitions_ShouldSyncCorrectly() {
    // preparation
    final ProductTypeDraft newProductTypeDraft = ProductTypeDraft.ofAttributeDefinitionDrafts("foo", "name", "desc", emptyList());
    final List<String> errorMessages = new ArrayList<>();
    final List<Throwable> exceptions = new ArrayList<>();
    final ProductTypeSyncOptions syncOptions = ProductTypeSyncOptionsBuilder.of(mock(SphereClient.class)).errorCallback((exception, oldResource, newResource, actions) -> {
        errorMessages.add(exception.getMessage());
        exceptions.add(exception);
    }).build();
    final ProductTypeService mockProductTypeService = mock(ProductTypeServiceImpl.class);
    final ProductType existingProductType = mock(ProductType.class);
    when(existingProductType.getKey()).thenReturn(newProductTypeDraft.getKey());
    when(mockProductTypeService.fetchMatchingProductTypesByKeys(singleton(newProductTypeDraft.getKey()))).thenReturn(CompletableFuture.completedFuture(singleton(existingProductType)));
    when(mockProductTypeService.fetchMatchingProductTypesByKeys(emptySet())).thenReturn(CompletableFuture.completedFuture(Collections.emptySet()));
    when(mockProductTypeService.updateProductType(any(), any())).thenReturn(CompletableFuture.completedFuture(existingProductType));
    when(mockProductTypeService.cacheKeysToIds(anySet())).thenReturn(CompletableFuture.completedFuture(emptyMap()));
    final ProductTypeSync productTypeSync = new ProductTypeSync(syncOptions, mockProductTypeService);
    // test
    final ProductTypeSyncStatistics productTypeSyncStatistics = productTypeSync.sync(singletonList(newProductTypeDraft)).toCompletableFuture().join();
    // assertions
    assertThat(errorMessages).isEmpty();
    assertThat(exceptions).isEmpty();
    assertThat(productTypeSyncStatistics).hasValues(1, 0, 1, 0, 0);
}
Also used : Reference(io.sphere.sdk.models.Reference) SyncException(com.commercetools.sync.commons.exceptions.SyncException) CompletableFuture.completedFuture(java.util.concurrent.CompletableFuture.completedFuture) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) UpdateAction(io.sphere.sdk.commands.UpdateAction) ProductTypeCreateCommand(io.sphere.sdk.producttypes.commands.ProductTypeCreateCommand) Collections.singletonList(java.util.Collections.singletonList) Collections.singleton(java.util.Collections.singleton) ProductTypeService(com.commercetools.sync.services.ProductTypeService) THROWABLE(org.assertj.core.api.InstanceOfAssertFactories.THROWABLE) SphereClient(io.sphere.sdk.client.SphereClient) ProductTypeQuery(io.sphere.sdk.producttypes.queries.ProductTypeQuery) ProductTypeUpdateCommand(io.sphere.sdk.producttypes.commands.ProductTypeUpdateCommand) ProductTypeDraftBuilder(io.sphere.sdk.producttypes.ProductTypeDraftBuilder) ResourceKeyIdGraphQlRequest(com.commercetools.sync.commons.helpers.ResourceKeyIdGraphQlRequest) Collections.emptyList(java.util.Collections.emptyList) CompletionException(java.util.concurrent.CompletionException) UUID(java.util.UUID) Test(org.junit.jupiter.api.Test) List(java.util.List) LocalizedString.ofEnglish(io.sphere.sdk.models.LocalizedString.ofEnglish) ProductTypeServiceImpl(com.commercetools.sync.services.impl.ProductTypeServiceImpl) Sets.newLinkedHashSet(org.assertj.core.util.Sets.newLinkedHashSet) Optional(java.util.Optional) AttributeDefinitionDraft(io.sphere.sdk.products.attributes.AttributeDefinitionDraft) Mockito.mock(org.mockito.Mockito.mock) ProductTypeSyncStatistics(com.commercetools.sync.producttypes.helpers.ProductTypeSyncStatistics) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) ArgumentMatchers.anySet(org.mockito.ArgumentMatchers.anySet) ProductType(io.sphere.sdk.producttypes.ProductType) AssertionsForStatistics.assertThat(com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics.assertThat) CompletableFuture(java.util.concurrent.CompletableFuture) Mockito.spy(org.mockito.Mockito.spy) ArrayList(java.util.ArrayList) Assertions.as(org.assertj.core.api.Assertions.as) CompletableFuture.supplyAsync(java.util.concurrent.CompletableFuture.supplyAsync) SphereException(io.sphere.sdk.models.SphereException) ChangeDescription(io.sphere.sdk.producttypes.commands.updateactions.ChangeDescription) Collections.emptyMap(java.util.Collections.emptyMap) AttributeDefinitionDraftBuilder(io.sphere.sdk.products.attributes.AttributeDefinitionDraftBuilder) Collections.emptySet(java.util.Collections.emptySet) ProductType.referenceOfId(io.sphere.sdk.producttypes.ProductType.referenceOfId) ProductTypeDraft(io.sphere.sdk.producttypes.ProductTypeDraft) Lists.list(org.assertj.core.util.Lists.list) Mockito.when(org.mockito.Mockito.when) ChangeName(io.sphere.sdk.producttypes.commands.updateactions.ChangeName) Mockito.verify(org.mockito.Mockito.verify) Mockito.never(org.mockito.Mockito.never) NestedAttributeType(io.sphere.sdk.products.attributes.NestedAttributeType) PagedQueryResult(io.sphere.sdk.queries.PagedQueryResult) STRING(org.assertj.core.api.InstanceOfAssertFactories.STRING) Collections(java.util.Collections) ArrayList(java.util.ArrayList) ProductType(io.sphere.sdk.producttypes.ProductType) ProductTypeSyncStatistics(com.commercetools.sync.producttypes.helpers.ProductTypeSyncStatistics) ProductTypeDraft(io.sphere.sdk.producttypes.ProductTypeDraft) ProductTypeService(com.commercetools.sync.services.ProductTypeService) SphereClient(io.sphere.sdk.client.SphereClient) Test(org.junit.jupiter.api.Test)

Example 24 with ProductTypeService

use of com.commercetools.sync.services.ProductTypeService in project commercetools-sync-java by commercetools.

the class AttributeDefinitionReferenceResolverTest method resolveReferences_WithSetOfNestedTypeWithInvalidProductTypeReference_ShouldNotResolveReferences.

@Test
void resolveReferences_WithSetOfNestedTypeWithInvalidProductTypeReference_ShouldNotResolveReferences() {
    // preparation
    final NestedAttributeType nestedAttributeType = NestedAttributeType.of(ProductType.reference(""));
    final SetAttributeType setAttributeType = SetAttributeType.of(nestedAttributeType);
    final AttributeDefinitionDraft attributeDefinitionDraft = AttributeDefinitionDraftBuilder.of(setAttributeType, "foo", ofEnglish("foo"), true).build();
    final ProductTypeSyncOptions syncOptions = ProductTypeSyncOptionsBuilder.of(mock(SphereClient.class)).build();
    final ProductTypeService productTypeService = mock(ProductTypeService.class);
    when(productTypeService.fetchCachedProductTypeId(any())).thenReturn(CompletableFuture.completedFuture(Optional.empty()));
    final AttributeDefinitionReferenceResolver attributeDefinitionReferenceResolver = new AttributeDefinitionReferenceResolver(syncOptions, productTypeService);
    // test and assertion
    assertThat(attributeDefinitionReferenceResolver.resolveReferences(attributeDefinitionDraft)).failsWithin(1, TimeUnit.SECONDS).withThrowableOfType(ExecutionException.class).withCauseExactlyInstanceOf(ReferenceResolutionException.class).withMessageContaining("Failed to resolve references on attribute definition with name 'foo'");
}
Also used : ProductTypeService(com.commercetools.sync.services.ProductTypeService) ProductTypeSyncOptions(com.commercetools.sync.producttypes.ProductTypeSyncOptions) AttributeDefinitionDraft(io.sphere.sdk.products.attributes.AttributeDefinitionDraft) ReferenceResolutionException(com.commercetools.sync.commons.exceptions.ReferenceResolutionException) NestedAttributeType(io.sphere.sdk.products.attributes.NestedAttributeType) SetAttributeType(io.sphere.sdk.products.attributes.SetAttributeType) Test(org.junit.jupiter.api.Test)

Example 25 with ProductTypeService

use of com.commercetools.sync.services.ProductTypeService in project commercetools-sync-java by commercetools.

the class AttributeDefinitionReferenceResolverTest method resolveReferences_WithSetOfNonNestedType_ShouldResolveReferences.

@Test
void resolveReferences_WithSetOfNonNestedType_ShouldResolveReferences() {
    // preparation
    final SetAttributeType setAttributeType = SetAttributeType.of(StringAttributeType.of());
    final AttributeDefinitionDraft attributeDefinitionDraft = AttributeDefinitionDraftBuilder.of(setAttributeType, "foo", ofEnglish("foo"), true).build();
    final ProductTypeSyncOptions syncOptions = ProductTypeSyncOptionsBuilder.of(mock(SphereClient.class)).build();
    final ProductTypeService productTypeService = mock(ProductTypeService.class);
    when(productTypeService.fetchCachedProductTypeId(any())).thenReturn(CompletableFuture.completedFuture(Optional.of("foo")));
    final AttributeDefinitionReferenceResolver attributeDefinitionReferenceResolver = new AttributeDefinitionReferenceResolver(syncOptions, productTypeService);
    // test and assertion
    assertThat(attributeDefinitionReferenceResolver.resolveReferences(attributeDefinitionDraft)).isCompletedWithValue(attributeDefinitionDraft);
}
Also used : ProductTypeService(com.commercetools.sync.services.ProductTypeService) ProductTypeSyncOptions(com.commercetools.sync.producttypes.ProductTypeSyncOptions) AttributeDefinitionDraft(io.sphere.sdk.products.attributes.AttributeDefinitionDraft) SetAttributeType(io.sphere.sdk.products.attributes.SetAttributeType) Test(org.junit.jupiter.api.Test)

Aggregations

ProductTypeService (com.commercetools.sync.services.ProductTypeService)32 Test (org.junit.jupiter.api.Test)31 ProductTypeDraft (io.sphere.sdk.producttypes.ProductTypeDraft)22 ProductTypeSyncOptions (com.commercetools.sync.producttypes.ProductTypeSyncOptions)20 AttributeDefinitionDraft (io.sphere.sdk.products.attributes.AttributeDefinitionDraft)20 SphereClient (io.sphere.sdk.client.SphereClient)18 NestedAttributeType (io.sphere.sdk.products.attributes.NestedAttributeType)18 ProductTypeQuery (io.sphere.sdk.producttypes.queries.ProductTypeQuery)16 Optional (java.util.Optional)16 ProductTypeServiceImpl (com.commercetools.sync.services.impl.ProductTypeServiceImpl)15 ProductType (io.sphere.sdk.producttypes.ProductType)15 ChangeName (io.sphere.sdk.producttypes.commands.updateactions.ChangeName)13 ArrayList (java.util.ArrayList)13 Collections (java.util.Collections)13 Collections.singleton (java.util.Collections.singleton)13 Collections.singletonList (java.util.Collections.singletonList)13 List (java.util.List)13 ProductTypeCreateCommand (io.sphere.sdk.producttypes.commands.ProductTypeCreateCommand)10 ProductTypeUpdateCommand (io.sphere.sdk.producttypes.commands.ProductTypeUpdateCommand)10 Assertions.as (org.assertj.core.api.Assertions.as)7