Search in sources :

Example 21 with CategoryService

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

the class CategoryReferenceResolverTest method resolveCategoryReferences_WithCategoryKeysAndNoCategoryOrderHints_ShouldResolveReferences.

@Test
void resolveCategoryReferences_WithCategoryKeysAndNoCategoryOrderHints_ShouldResolveReferences() {
    // preparation
    final int nCategories = 10;
    final List<Category> categories = IntStream.range(0, nCategories).mapToObj(i -> i + "").map(key -> getMockCategory(key, key)).collect(Collectors.toList());
    final CategoryService mockCategoryService = mockCategoryService(new HashSet<>(categories), null);
    final Set<ResourceIdentifier<Category>> categoryResourceIdentifiers = categories.stream().map(category -> ResourceIdentifier.<Category>ofKey(category.getKey())).collect(toSet());
    final ProductDraftBuilder productBuilder = getBuilderWithRandomProductType().categories(categoryResourceIdentifiers);
    final ProductReferenceResolver productReferenceResolver = createProductReferenceResolver(mockCategoryService);
    // test
    final ProductDraftBuilder resolvedDraft = productReferenceResolver.resolveCategoryReferences(productBuilder).toCompletableFuture().join();
    // assertion
    assertThat(resolvedDraft.getCategories()).hasSameElementsAs(categoryResourceIdentifiers.stream().map(categoryResourceIdentifier -> Category.referenceOfId(categoryResourceIdentifier.getKey())).collect(toSet()));
    assertThat(resolvedDraft.getCategoryOrderHints()).isNotNull();
    assertThat(resolvedDraft.getCategoryOrderHints().getAsMap()).isEmpty();
}
Also used : ReferenceResolutionException(com.commercetools.sync.commons.exceptions.ReferenceResolutionException) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) ProductSyncMockUtils.getMockProductService(com.commercetools.sync.products.ProductSyncMockUtils.getMockProductService) Collections.singleton(java.util.Collections.singleton) Map(java.util.Map) ProductSyncMockUtils.getMockCustomObjectService(com.commercetools.sync.products.ProductSyncMockUtils.getMockCustomObjectService) SphereClient(io.sphere.sdk.client.SphereClient) InventorySyncMockUtils.getMockSupplyChannel(com.commercetools.sync.inventories.InventorySyncMockUtils.getMockSupplyChannel) Collectors.toSet(java.util.stream.Collectors.toSet) Category(io.sphere.sdk.categories.Category) Set(java.util.Set) CategoryService(com.commercetools.sync.services.CategoryService) Collectors(java.util.stream.Collectors) String.format(java.lang.String.format) Objects(java.util.Objects) Test(org.junit.jupiter.api.Test) List(java.util.List) ProductSyncOptionsBuilder(com.commercetools.sync.products.ProductSyncOptionsBuilder) SphereInternalUtils.asSet(io.sphere.sdk.utils.SphereInternalUtils.asSet) ProductSyncOptions(com.commercetools.sync.products.ProductSyncOptions) Mockito.mock(org.mockito.Mockito.mock) ResourceIdentifier(io.sphere.sdk.models.ResourceIdentifier) IntStream(java.util.stream.IntStream) ArgumentMatchers.anySet(org.mockito.ArgumentMatchers.anySet) InventorySyncMockUtils.getMockChannelService(com.commercetools.sync.inventories.InventorySyncMockUtils.getMockChannelService) CategoryOrderHints(io.sphere.sdk.products.CategoryOrderHints) CategorySyncMockUtils.getMockCategory(com.commercetools.sync.categories.CategorySyncMockUtils.getMockCategory) ProductSyncMockUtils.getBuilderWithRandomProductType(com.commercetools.sync.products.ProductSyncMockUtils.getBuilderWithRandomProductType) CompletableFuture(java.util.concurrent.CompletableFuture) ProductReferenceResolver(com.commercetools.sync.products.helpers.ProductReferenceResolver) HashSet(java.util.HashSet) ProductSyncMockUtils.getMockTaxCategoryService(com.commercetools.sync.products.ProductSyncMockUtils.getMockTaxCategoryService) ProductSyncMockUtils.getMockProductTypeService(com.commercetools.sync.products.ProductSyncMockUtils.getMockProductTypeService) SphereException(io.sphere.sdk.models.SphereException) ProductSyncMockUtils.getMockStateService(com.commercetools.sync.products.ProductSyncMockUtils.getMockStateService) ProductSyncMockUtils.getMockCustomerService(com.commercetools.sync.products.ProductSyncMockUtils.getMockCustomerService) ProductDraftBuilder(io.sphere.sdk.products.ProductDraftBuilder) Nonnull(javax.annotation.Nonnull) Collections.emptySet(java.util.Collections.emptySet) FAILED_TO_RESOLVE_REFERENCE(com.commercetools.sync.products.helpers.ProductReferenceResolver.FAILED_TO_RESOLVE_REFERENCE) Mockito.when(org.mockito.Mockito.when) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) MockUtils.getMockTypeService(com.commercetools.sync.commons.MockUtils.getMockTypeService) CustomerGroupService(com.commercetools.sync.services.CustomerGroupService) CATEGORIES_DO_NOT_EXIST(com.commercetools.sync.products.helpers.ProductReferenceResolver.CATEGORIES_DO_NOT_EXIST) MockUtils.mockCategoryService(com.commercetools.sync.commons.MockUtils.mockCategoryService) Collections(java.util.Collections) BLANK_KEY_VALUE_ON_RESOURCE_IDENTIFIER(com.commercetools.sync.commons.helpers.BaseReferenceResolver.BLANK_KEY_VALUE_ON_RESOURCE_IDENTIFIER) ResourceIdentifier(io.sphere.sdk.models.ResourceIdentifier) ProductReferenceResolver(com.commercetools.sync.products.helpers.ProductReferenceResolver) Category(io.sphere.sdk.categories.Category) CategorySyncMockUtils.getMockCategory(com.commercetools.sync.categories.CategorySyncMockUtils.getMockCategory) CategoryService(com.commercetools.sync.services.CategoryService) ProductSyncMockUtils.getMockTaxCategoryService(com.commercetools.sync.products.ProductSyncMockUtils.getMockTaxCategoryService) MockUtils.mockCategoryService(com.commercetools.sync.commons.MockUtils.mockCategoryService) ProductDraftBuilder(io.sphere.sdk.products.ProductDraftBuilder) Test(org.junit.jupiter.api.Test)

Example 22 with CategoryService

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

the class CategoryReferenceResolverTest method resolveCategoryReferences_WithExceptionCategoryFetch_ShouldNotResolveReference.

@Test
void resolveCategoryReferences_WithExceptionCategoryFetch_ShouldNotResolveReference() {
    final Category category = getMockCategory("categoryKey", "categoryKey");
    final List<Category> categories = Collections.singletonList(category);
    final Set<ResourceIdentifier<Category>> categoryResourceIdentifiers = categories.stream().map(cat -> ResourceIdentifier.<Category>ofKey(cat.getKey())).collect(toSet());
    final CategoryService mockCategoryService = mockCategoryService(new HashSet<>(categories), null);
    final ProductDraftBuilder productBuilder = getBuilderWithRandomProductType().categories(categoryResourceIdentifiers);
    final CompletableFuture<Set<Category>> futureThrowingSphereException = new CompletableFuture<>();
    futureThrowingSphereException.completeExceptionally(new SphereException("CTP error on fetch"));
    when(mockCategoryService.fetchMatchingCategoriesByKeys(anySet())).thenReturn(futureThrowingSphereException);
    final ProductReferenceResolver productReferenceResolver = createProductReferenceResolver(mockCategoryService);
    // test and assertion
    assertThat(productReferenceResolver.resolveCategoryReferences(productBuilder)).failsWithin(1, TimeUnit.SECONDS).withThrowableOfType(ExecutionException.class).withCauseExactlyInstanceOf(SphereException.class).withMessageContaining("CTP error on fetch");
}
Also used : ReferenceResolutionException(com.commercetools.sync.commons.exceptions.ReferenceResolutionException) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) ProductSyncMockUtils.getMockProductService(com.commercetools.sync.products.ProductSyncMockUtils.getMockProductService) Collections.singleton(java.util.Collections.singleton) Map(java.util.Map) ProductSyncMockUtils.getMockCustomObjectService(com.commercetools.sync.products.ProductSyncMockUtils.getMockCustomObjectService) SphereClient(io.sphere.sdk.client.SphereClient) InventorySyncMockUtils.getMockSupplyChannel(com.commercetools.sync.inventories.InventorySyncMockUtils.getMockSupplyChannel) Collectors.toSet(java.util.stream.Collectors.toSet) Category(io.sphere.sdk.categories.Category) Set(java.util.Set) CategoryService(com.commercetools.sync.services.CategoryService) Collectors(java.util.stream.Collectors) String.format(java.lang.String.format) Objects(java.util.Objects) Test(org.junit.jupiter.api.Test) List(java.util.List) ProductSyncOptionsBuilder(com.commercetools.sync.products.ProductSyncOptionsBuilder) SphereInternalUtils.asSet(io.sphere.sdk.utils.SphereInternalUtils.asSet) ProductSyncOptions(com.commercetools.sync.products.ProductSyncOptions) Mockito.mock(org.mockito.Mockito.mock) ResourceIdentifier(io.sphere.sdk.models.ResourceIdentifier) IntStream(java.util.stream.IntStream) ArgumentMatchers.anySet(org.mockito.ArgumentMatchers.anySet) InventorySyncMockUtils.getMockChannelService(com.commercetools.sync.inventories.InventorySyncMockUtils.getMockChannelService) CategoryOrderHints(io.sphere.sdk.products.CategoryOrderHints) CategorySyncMockUtils.getMockCategory(com.commercetools.sync.categories.CategorySyncMockUtils.getMockCategory) ProductSyncMockUtils.getBuilderWithRandomProductType(com.commercetools.sync.products.ProductSyncMockUtils.getBuilderWithRandomProductType) CompletableFuture(java.util.concurrent.CompletableFuture) ProductReferenceResolver(com.commercetools.sync.products.helpers.ProductReferenceResolver) HashSet(java.util.HashSet) ProductSyncMockUtils.getMockTaxCategoryService(com.commercetools.sync.products.ProductSyncMockUtils.getMockTaxCategoryService) ProductSyncMockUtils.getMockProductTypeService(com.commercetools.sync.products.ProductSyncMockUtils.getMockProductTypeService) SphereException(io.sphere.sdk.models.SphereException) ProductSyncMockUtils.getMockStateService(com.commercetools.sync.products.ProductSyncMockUtils.getMockStateService) ProductSyncMockUtils.getMockCustomerService(com.commercetools.sync.products.ProductSyncMockUtils.getMockCustomerService) ProductDraftBuilder(io.sphere.sdk.products.ProductDraftBuilder) Nonnull(javax.annotation.Nonnull) Collections.emptySet(java.util.Collections.emptySet) FAILED_TO_RESOLVE_REFERENCE(com.commercetools.sync.products.helpers.ProductReferenceResolver.FAILED_TO_RESOLVE_REFERENCE) Mockito.when(org.mockito.Mockito.when) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) MockUtils.getMockTypeService(com.commercetools.sync.commons.MockUtils.getMockTypeService) CustomerGroupService(com.commercetools.sync.services.CustomerGroupService) CATEGORIES_DO_NOT_EXIST(com.commercetools.sync.products.helpers.ProductReferenceResolver.CATEGORIES_DO_NOT_EXIST) MockUtils.mockCategoryService(com.commercetools.sync.commons.MockUtils.mockCategoryService) Collections(java.util.Collections) BLANK_KEY_VALUE_ON_RESOURCE_IDENTIFIER(com.commercetools.sync.commons.helpers.BaseReferenceResolver.BLANK_KEY_VALUE_ON_RESOURCE_IDENTIFIER) ProductReferenceResolver(com.commercetools.sync.products.helpers.ProductReferenceResolver) Category(io.sphere.sdk.categories.Category) CategorySyncMockUtils.getMockCategory(com.commercetools.sync.categories.CategorySyncMockUtils.getMockCategory) Collectors.toSet(java.util.stream.Collectors.toSet) Set(java.util.Set) SphereInternalUtils.asSet(io.sphere.sdk.utils.SphereInternalUtils.asSet) ArgumentMatchers.anySet(org.mockito.ArgumentMatchers.anySet) HashSet(java.util.HashSet) Collections.emptySet(java.util.Collections.emptySet) SphereException(io.sphere.sdk.models.SphereException) ProductDraftBuilder(io.sphere.sdk.products.ProductDraftBuilder) ResourceIdentifier(io.sphere.sdk.models.ResourceIdentifier) CompletableFuture(java.util.concurrent.CompletableFuture) CategoryService(com.commercetools.sync.services.CategoryService) ProductSyncMockUtils.getMockTaxCategoryService(com.commercetools.sync.products.ProductSyncMockUtils.getMockTaxCategoryService) MockUtils.mockCategoryService(com.commercetools.sync.commons.MockUtils.mockCategoryService) Test(org.junit.jupiter.api.Test)

Example 23 with CategoryService

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

the class CategoryReferenceResolverTest method resolveCategoryReferences_WithNullCategoryReferences_ShouldNotResolveReferences.

@Test
void resolveCategoryReferences_WithNullCategoryReferences_ShouldNotResolveReferences() {
    // preparation
    final CategoryService mockCategoryService = mockCategoryService(emptySet(), null);
    final ProductDraftBuilder productBuilder = getBuilderWithRandomProductType();
    final ProductReferenceResolver productReferenceResolver = createProductReferenceResolver(mockCategoryService);
    // test and assertion
    assertThat(productReferenceResolver.resolveCategoryReferences(productBuilder).toCompletableFuture()).matches(f -> !f.isCompletedExceptionally() || f.isCancelled()).isCompletedWithValueMatching(resolvedDraft -> resolvedDraft.getCategories().isEmpty());
}
Also used : ReferenceResolutionException(com.commercetools.sync.commons.exceptions.ReferenceResolutionException) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) ProductSyncMockUtils.getMockProductService(com.commercetools.sync.products.ProductSyncMockUtils.getMockProductService) Collections.singleton(java.util.Collections.singleton) Map(java.util.Map) ProductSyncMockUtils.getMockCustomObjectService(com.commercetools.sync.products.ProductSyncMockUtils.getMockCustomObjectService) SphereClient(io.sphere.sdk.client.SphereClient) InventorySyncMockUtils.getMockSupplyChannel(com.commercetools.sync.inventories.InventorySyncMockUtils.getMockSupplyChannel) Collectors.toSet(java.util.stream.Collectors.toSet) Category(io.sphere.sdk.categories.Category) Set(java.util.Set) CategoryService(com.commercetools.sync.services.CategoryService) Collectors(java.util.stream.Collectors) String.format(java.lang.String.format) Objects(java.util.Objects) Test(org.junit.jupiter.api.Test) List(java.util.List) ProductSyncOptionsBuilder(com.commercetools.sync.products.ProductSyncOptionsBuilder) SphereInternalUtils.asSet(io.sphere.sdk.utils.SphereInternalUtils.asSet) ProductSyncOptions(com.commercetools.sync.products.ProductSyncOptions) Mockito.mock(org.mockito.Mockito.mock) ResourceIdentifier(io.sphere.sdk.models.ResourceIdentifier) IntStream(java.util.stream.IntStream) ArgumentMatchers.anySet(org.mockito.ArgumentMatchers.anySet) InventorySyncMockUtils.getMockChannelService(com.commercetools.sync.inventories.InventorySyncMockUtils.getMockChannelService) CategoryOrderHints(io.sphere.sdk.products.CategoryOrderHints) CategorySyncMockUtils.getMockCategory(com.commercetools.sync.categories.CategorySyncMockUtils.getMockCategory) ProductSyncMockUtils.getBuilderWithRandomProductType(com.commercetools.sync.products.ProductSyncMockUtils.getBuilderWithRandomProductType) CompletableFuture(java.util.concurrent.CompletableFuture) ProductReferenceResolver(com.commercetools.sync.products.helpers.ProductReferenceResolver) HashSet(java.util.HashSet) ProductSyncMockUtils.getMockTaxCategoryService(com.commercetools.sync.products.ProductSyncMockUtils.getMockTaxCategoryService) ProductSyncMockUtils.getMockProductTypeService(com.commercetools.sync.products.ProductSyncMockUtils.getMockProductTypeService) SphereException(io.sphere.sdk.models.SphereException) ProductSyncMockUtils.getMockStateService(com.commercetools.sync.products.ProductSyncMockUtils.getMockStateService) ProductSyncMockUtils.getMockCustomerService(com.commercetools.sync.products.ProductSyncMockUtils.getMockCustomerService) ProductDraftBuilder(io.sphere.sdk.products.ProductDraftBuilder) Nonnull(javax.annotation.Nonnull) Collections.emptySet(java.util.Collections.emptySet) FAILED_TO_RESOLVE_REFERENCE(com.commercetools.sync.products.helpers.ProductReferenceResolver.FAILED_TO_RESOLVE_REFERENCE) Mockito.when(org.mockito.Mockito.when) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) MockUtils.getMockTypeService(com.commercetools.sync.commons.MockUtils.getMockTypeService) CustomerGroupService(com.commercetools.sync.services.CustomerGroupService) CATEGORIES_DO_NOT_EXIST(com.commercetools.sync.products.helpers.ProductReferenceResolver.CATEGORIES_DO_NOT_EXIST) MockUtils.mockCategoryService(com.commercetools.sync.commons.MockUtils.mockCategoryService) Collections(java.util.Collections) BLANK_KEY_VALUE_ON_RESOURCE_IDENTIFIER(com.commercetools.sync.commons.helpers.BaseReferenceResolver.BLANK_KEY_VALUE_ON_RESOURCE_IDENTIFIER) ProductReferenceResolver(com.commercetools.sync.products.helpers.ProductReferenceResolver) CategoryService(com.commercetools.sync.services.CategoryService) ProductSyncMockUtils.getMockTaxCategoryService(com.commercetools.sync.products.ProductSyncMockUtils.getMockTaxCategoryService) MockUtils.mockCategoryService(com.commercetools.sync.commons.MockUtils.mockCategoryService) ProductDraftBuilder(io.sphere.sdk.products.ProductDraftBuilder) Test(org.junit.jupiter.api.Test)

Example 24 with CategoryService

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

the class CategoryReferenceResolverTest method resolveCategoryReferences_WithCategoryReferencesWithId_ShouldResolveReference.

@Test
void resolveCategoryReferences_WithCategoryReferencesWithId_ShouldResolveReference() {
    // preparation
    final CategoryService mockCategoryService = mockCategoryService(emptySet(), null);
    final ProductDraftBuilder productBuilder = getBuilderWithRandomProductType().categories(singleton(ResourceIdentifier.ofId("existing-category-id")));
    final ProductReferenceResolver productReferenceResolver = createProductReferenceResolver(mockCategoryService);
    final ProductDraftBuilder resolvedDraft = productReferenceResolver.resolveCategoryReferences(productBuilder).toCompletableFuture().join();
    // assertion
    assertThat(resolvedDraft.getCategories()).isEqualTo(singleton(ResourceIdentifier.ofId("existing-category-id")));
}
Also used : ProductReferenceResolver(com.commercetools.sync.products.helpers.ProductReferenceResolver) CategoryService(com.commercetools.sync.services.CategoryService) ProductSyncMockUtils.getMockTaxCategoryService(com.commercetools.sync.products.ProductSyncMockUtils.getMockTaxCategoryService) MockUtils.mockCategoryService(com.commercetools.sync.commons.MockUtils.mockCategoryService) ProductDraftBuilder(io.sphere.sdk.products.ProductDraftBuilder) Test(org.junit.jupiter.api.Test)

Example 25 with CategoryService

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

the class CategoryReferenceResolverTest method resolveCategoryReferences_WithIdOnCategoryReference_ShouldNotResolveReference.

@Test
void resolveCategoryReferences_WithIdOnCategoryReference_ShouldNotResolveReference() {
    // preparation
    final CategoryService mockCategoryService = mockCategoryService(emptySet(), null);
    final ProductDraftBuilder productBuilder = getBuilderWithRandomProductType().categories(asSet(ResourceIdentifier.ofId("existing-id"), null));
    final ProductReferenceResolver productReferenceResolver = createProductReferenceResolver(mockCategoryService);
    // test and assertion
    assertThat(productReferenceResolver.resolveCategoryReferences(productBuilder).toCompletableFuture()).matches(f -> !f.isCompletedExceptionally() || f.isCancelled()).isCompletedWithValueMatching(resolvedDraft -> Objects.equals(resolvedDraft.getCategories(), productBuilder.getCategories()));
}
Also used : ReferenceResolutionException(com.commercetools.sync.commons.exceptions.ReferenceResolutionException) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) ProductSyncMockUtils.getMockProductService(com.commercetools.sync.products.ProductSyncMockUtils.getMockProductService) Collections.singleton(java.util.Collections.singleton) Map(java.util.Map) ProductSyncMockUtils.getMockCustomObjectService(com.commercetools.sync.products.ProductSyncMockUtils.getMockCustomObjectService) SphereClient(io.sphere.sdk.client.SphereClient) InventorySyncMockUtils.getMockSupplyChannel(com.commercetools.sync.inventories.InventorySyncMockUtils.getMockSupplyChannel) Collectors.toSet(java.util.stream.Collectors.toSet) Category(io.sphere.sdk.categories.Category) Set(java.util.Set) CategoryService(com.commercetools.sync.services.CategoryService) Collectors(java.util.stream.Collectors) String.format(java.lang.String.format) Objects(java.util.Objects) Test(org.junit.jupiter.api.Test) List(java.util.List) ProductSyncOptionsBuilder(com.commercetools.sync.products.ProductSyncOptionsBuilder) SphereInternalUtils.asSet(io.sphere.sdk.utils.SphereInternalUtils.asSet) ProductSyncOptions(com.commercetools.sync.products.ProductSyncOptions) Mockito.mock(org.mockito.Mockito.mock) ResourceIdentifier(io.sphere.sdk.models.ResourceIdentifier) IntStream(java.util.stream.IntStream) ArgumentMatchers.anySet(org.mockito.ArgumentMatchers.anySet) InventorySyncMockUtils.getMockChannelService(com.commercetools.sync.inventories.InventorySyncMockUtils.getMockChannelService) CategoryOrderHints(io.sphere.sdk.products.CategoryOrderHints) CategorySyncMockUtils.getMockCategory(com.commercetools.sync.categories.CategorySyncMockUtils.getMockCategory) ProductSyncMockUtils.getBuilderWithRandomProductType(com.commercetools.sync.products.ProductSyncMockUtils.getBuilderWithRandomProductType) CompletableFuture(java.util.concurrent.CompletableFuture) ProductReferenceResolver(com.commercetools.sync.products.helpers.ProductReferenceResolver) HashSet(java.util.HashSet) ProductSyncMockUtils.getMockTaxCategoryService(com.commercetools.sync.products.ProductSyncMockUtils.getMockTaxCategoryService) ProductSyncMockUtils.getMockProductTypeService(com.commercetools.sync.products.ProductSyncMockUtils.getMockProductTypeService) SphereException(io.sphere.sdk.models.SphereException) ProductSyncMockUtils.getMockStateService(com.commercetools.sync.products.ProductSyncMockUtils.getMockStateService) ProductSyncMockUtils.getMockCustomerService(com.commercetools.sync.products.ProductSyncMockUtils.getMockCustomerService) ProductDraftBuilder(io.sphere.sdk.products.ProductDraftBuilder) Nonnull(javax.annotation.Nonnull) Collections.emptySet(java.util.Collections.emptySet) FAILED_TO_RESOLVE_REFERENCE(com.commercetools.sync.products.helpers.ProductReferenceResolver.FAILED_TO_RESOLVE_REFERENCE) Mockito.when(org.mockito.Mockito.when) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) MockUtils.getMockTypeService(com.commercetools.sync.commons.MockUtils.getMockTypeService) CustomerGroupService(com.commercetools.sync.services.CustomerGroupService) CATEGORIES_DO_NOT_EXIST(com.commercetools.sync.products.helpers.ProductReferenceResolver.CATEGORIES_DO_NOT_EXIST) MockUtils.mockCategoryService(com.commercetools.sync.commons.MockUtils.mockCategoryService) Collections(java.util.Collections) BLANK_KEY_VALUE_ON_RESOURCE_IDENTIFIER(com.commercetools.sync.commons.helpers.BaseReferenceResolver.BLANK_KEY_VALUE_ON_RESOURCE_IDENTIFIER) ProductReferenceResolver(com.commercetools.sync.products.helpers.ProductReferenceResolver) CategoryService(com.commercetools.sync.services.CategoryService) ProductSyncMockUtils.getMockTaxCategoryService(com.commercetools.sync.products.ProductSyncMockUtils.getMockTaxCategoryService) MockUtils.mockCategoryService(com.commercetools.sync.commons.MockUtils.mockCategoryService) ProductDraftBuilder(io.sphere.sdk.products.ProductDraftBuilder) Test(org.junit.jupiter.api.Test)

Aggregations

CategoryService (com.commercetools.sync.services.CategoryService)35 Test (org.junit.jupiter.api.Test)32 MockUtils.mockCategoryService (com.commercetools.sync.commons.MockUtils.mockCategoryService)27 Category (io.sphere.sdk.categories.Category)24 CategorySyncMockUtils.getMockCategory (com.commercetools.sync.categories.CategorySyncMockUtils.getMockCategory)20 CategoryDraft (io.sphere.sdk.categories.CategoryDraft)19 HashSet (java.util.HashSet)18 CategorySyncMockUtils.getMockCategoryDraft (com.commercetools.sync.categories.CategorySyncMockUtils.getMockCategoryDraft)15 CategorySyncStatistics (com.commercetools.sync.categories.helpers.CategorySyncStatistics)15 SphereClient (io.sphere.sdk.client.SphereClient)15 Set (java.util.Set)15 Collections (java.util.Collections)14 List (java.util.List)14 Map (java.util.Map)14 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)14 Mockito.when (org.mockito.Mockito.when)14 ReferenceResolutionException (com.commercetools.sync.commons.exceptions.ReferenceResolutionException)12 SphereException (io.sphere.sdk.models.SphereException)12 CompletableFuture (java.util.concurrent.CompletableFuture)12 ResourceIdentifier (io.sphere.sdk.models.ResourceIdentifier)11