Search in sources :

Example 11 with TaxCategoryService

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

the class TaxCategoryServiceImplIT method createTaxCategory_WithDuplicateKey_ShouldHaveEmptyOptionalAsAResult.

@Test
void createTaxCategory_WithDuplicateKey_ShouldHaveEmptyOptionalAsAResult() {
    // preparation
    final TaxCategoryDraft newTaxCategoryDraft = TaxCategoryDraftBuilder.of(TAXCATEGORY_NAME_1, singletonList(createTaxRateDraft()), TAXCATEGORY_DESCRIPTION_1).key(TAXCATEGORY_KEY).build();
    final TaxCategorySyncOptions options = TaxCategorySyncOptionsBuilder.of(CTP_TARGET_CLIENT).errorCallback((exception, oldResource, newResource, updateActions) -> {
        errorCallBackMessages.add(exception.getMessage());
        errorCallBackExceptions.add(exception.getCause());
    }).build();
    final TaxCategoryService taxCategoryService = new TaxCategoryServiceImpl(options);
    // test
    final Optional<TaxCategory> result = taxCategoryService.createTaxCategory(newTaxCategoryDraft).toCompletableFuture().join();
    // assertion
    assertThat(result).isEmpty();
    assertThat(errorCallBackMessages).hasSize(1).singleElement(as(STRING)).contains("A duplicate value");
    assertThat(errorCallBackExceptions).hasSize(1).singleElement().matches(exception -> {
        assertThat(exception).isExactlyInstanceOf(ErrorResponseException.class);
        final ErrorResponseException errorResponseException = (ErrorResponseException) exception;
        final List<DuplicateFieldError> fieldErrors = errorResponseException.getErrors().stream().map(sphereError -> {
            assertThat(sphereError.getCode()).isEqualTo(DuplicateFieldError.CODE);
            return sphereError.as(DuplicateFieldError.class);
        }).collect(toList());
        return fieldErrors.size() == 1;
    });
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) BeforeEach(org.junit.jupiter.api.BeforeEach) TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) TaxCategoryITUtils.createTaxCategory(com.commercetools.sync.integration.commons.utils.TaxCategoryITUtils.createTaxCategory) TaxCategoryQuery(io.sphere.sdk.taxcategories.queries.TaxCategoryQuery) TAXCATEGORY_DESCRIPTION_1(com.commercetools.sync.integration.commons.utils.TaxCategoryITUtils.TAXCATEGORY_DESCRIPTION_1) Mockito.spy(org.mockito.Mockito.spy) CompletableFutureUtils(io.sphere.sdk.utils.CompletableFutureUtils) StringUtils(org.apache.commons.lang3.StringUtils) DuplicateFieldError(io.sphere.sdk.models.errors.DuplicateFieldError) Collections.singletonList(java.util.Collections.singletonList) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) AfterAll(org.junit.jupiter.api.AfterAll) SetKey(io.sphere.sdk.taxcategories.commands.updateactions.SetKey) Collections.singleton(java.util.Collections.singleton) TAXCATEGORY_KEY_1(com.commercetools.sync.integration.commons.utils.TaxCategoryITUtils.TAXCATEGORY_KEY_1) Assertions.as(org.assertj.core.api.Assertions.as) SphereClient(io.sphere.sdk.client.SphereClient) TaxCategoryService(com.commercetools.sync.services.TaxCategoryService) TaxCategoryDraftBuilder(io.sphere.sdk.taxcategories.TaxCategoryDraftBuilder) TaxCategoryITUtils.createTaxRateDraft(com.commercetools.sync.integration.commons.utils.TaxCategoryITUtils.createTaxRateDraft) BadGatewayException(io.sphere.sdk.client.BadGatewayException) TaxCategorySyncOptionsBuilder(com.commercetools.sync.taxcategories.TaxCategorySyncOptionsBuilder) CompletionStageUtil.executeBlocking(com.commercetools.tests.utils.CompletionStageUtil.executeBlocking) Set(java.util.Set) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) ChangeName(io.sphere.sdk.taxcategories.commands.updateactions.ChangeName) Mockito.verify(org.mockito.Mockito.verify) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Test(org.junit.jupiter.api.Test) Collectors.toList(java.util.stream.Collectors.toList) List(java.util.List) TaxCategorySyncOptions(com.commercetools.sync.taxcategories.TaxCategorySyncOptions) ErrorResponseException(io.sphere.sdk.client.ErrorResponseException) TaxCategoryServiceImpl(com.commercetools.sync.services.impl.TaxCategoryServiceImpl) Optional(java.util.Optional) TAXCATEGORY_KEY(com.commercetools.sync.integration.commons.utils.TaxCategoryITUtils.TAXCATEGORY_KEY) STRING(org.assertj.core.api.InstanceOfAssertFactories.STRING) TaxCategoryITUtils.deleteTaxCategories(com.commercetools.sync.integration.commons.utils.TaxCategoryITUtils.deleteTaxCategories) Collections(java.util.Collections) CTP_TARGET_CLIENT(com.commercetools.sync.integration.commons.utils.SphereClientUtils.CTP_TARGET_CLIENT) TAXCATEGORY_NAME_1(com.commercetools.sync.integration.commons.utils.TaxCategoryITUtils.TAXCATEGORY_NAME_1) TaxCategory(io.sphere.sdk.taxcategories.TaxCategory) TaxCategoryServiceImpl(com.commercetools.sync.services.impl.TaxCategoryServiceImpl) TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) TaxCategorySyncOptions(com.commercetools.sync.taxcategories.TaxCategorySyncOptions) TaxCategoryITUtils.createTaxCategory(com.commercetools.sync.integration.commons.utils.TaxCategoryITUtils.createTaxCategory) TaxCategory(io.sphere.sdk.taxcategories.TaxCategory) DuplicateFieldError(io.sphere.sdk.models.errors.DuplicateFieldError) TaxCategoryService(com.commercetools.sync.services.TaxCategoryService) ErrorResponseException(io.sphere.sdk.client.ErrorResponseException) Test(org.junit.jupiter.api.Test)

Example 12 with TaxCategoryService

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

the class TaxCategorySyncTest method sync_WithDuplicatedState_ShouldNotBuildActionAndTriggerErrorCallback.

@Test
void sync_WithDuplicatedState_ShouldNotBuildActionAndTriggerErrorCallback() {
    final String name = "DuplicatedName";
    final TaxCategoryDraft draft = TaxCategoryDraftBuilder.of(name, asList(// replace
    TaxRateDraftBuilder.of(name, 2.0, false, CountryCode.FR).state("NYON").build(), TaxRateDraftBuilder.of(name, 2.0, false, CountryCode.FR).state("PARIS").build(), TaxRateDraftBuilder.of(name, 3.0, false, CountryCode.DE).state("BERLIN").build(), TaxRateDraftBuilder.of(name, 3.0, false, CountryCode.DE).state("BERLIN").build()), "desc").key("someKey").build();
    final AtomicReference<String> callback = new AtomicReference<>(null);
    final TaxCategorySyncOptions syncOptions = TaxCategorySyncOptionsBuilder.of(mock(SphereClient.class)).errorCallback((exception, taxDraft, entry, actions) -> callback.set(exception.getMessage())).build();
    final TaxCategorySync sync = new TaxCategorySync(syncOptions, taxCategoryService);
    final TaxCategory taxCategory = mock(TaxCategory.class);
    when(taxCategory.getId()).thenReturn("id");
    when(taxCategory.getKey()).thenReturn("someKey");
    when(taxCategoryService.fetchMatchingTaxCategoriesByKeys(any())).thenReturn(completedFuture(new HashSet<>(singletonList(taxCategory))));
    when(taxCategoryService.updateTaxCategory(any(), any())).thenReturn(completedFuture(taxCategory));
    final TaxCategorySyncStatistics result = sync.sync(singletonList(draft)).toCompletableFuture().join();
    assertAll(() -> assertThat(result.getProcessed().get()).isEqualTo(1), () -> assertThat(result.getUpdated().get()).isEqualTo(0), () -> assertThat(result.getFailed().get()).isEqualTo(1), () -> assertThat(callback.get()).contains(format("Tax rate drafts have duplicated country codes and states. Duplicated " + "tax rate country code: '%s'. state : '%s'. Tax rate country codes and states are " + "expected to be unique inside their tax category.", CountryCode.DE, "BERLIN")));
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Optional.empty(java.util.Optional.empty) TaxCategorySyncStatistics(com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics) TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) CompletableFuture.completedFuture(java.util.concurrent.CompletableFuture.completedFuture) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) AtomicReference(java.util.concurrent.atomic.AtomicReference) Collections.singletonList(java.util.Collections.singletonList) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) Arrays.asList(java.util.Arrays.asList) Assertions.as(org.assertj.core.api.Assertions.as) CompletableFuture.supplyAsync(java.util.concurrent.CompletableFuture.supplyAsync) SphereClient(io.sphere.sdk.client.SphereClient) SphereException(io.sphere.sdk.models.SphereException) TaxCategoryService(com.commercetools.sync.services.TaxCategoryService) Assertions.assertAll(org.junit.jupiter.api.Assertions.assertAll) TaxCategoryDraftBuilder(io.sphere.sdk.taxcategories.TaxCategoryDraftBuilder) CountryCode(com.neovisionaries.i18n.CountryCode) Collections.emptySet(java.util.Collections.emptySet) Collections.emptyList(java.util.Collections.emptyList) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) String.format(java.lang.String.format) Mockito.verify(org.mockito.Mockito.verify) Test(org.junit.jupiter.api.Test) List(java.util.List) AfterEach(org.junit.jupiter.api.AfterEach) TaxRateDraftBuilder(io.sphere.sdk.taxcategories.TaxRateDraftBuilder) ConcurrentModificationException(io.sphere.sdk.client.ConcurrentModificationException) Optional(java.util.Optional) STRING(org.assertj.core.api.InstanceOfAssertFactories.STRING) Mockito.reset(org.mockito.Mockito.reset) Mockito.mock(org.mockito.Mockito.mock) TaxCategory(io.sphere.sdk.taxcategories.TaxCategory) TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) TaxCategory(io.sphere.sdk.taxcategories.TaxCategory) TaxCategorySyncStatistics(com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics) SphereClient(io.sphere.sdk.client.SphereClient) AtomicReference(java.util.concurrent.atomic.AtomicReference) HashSet(java.util.HashSet) Test(org.junit.jupiter.api.Test)

Example 13 with TaxCategoryService

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

the class TaxCategorySyncTest method sync_WithInvalidDrafts_ShouldApplyErrorCallbackAndIncrementFailed.

@Test
void sync_WithInvalidDrafts_ShouldApplyErrorCallbackAndIncrementFailed() {
    final List<String> errors = new ArrayList<>();
    final TaxCategorySyncOptions options = TaxCategorySyncOptionsBuilder.of(mock(SphereClient.class)).errorCallback((exception, draft, entry, actions) -> errors.add(exception.getMessage())).build();
    final TaxCategorySync sync = new TaxCategorySync(options, taxCategoryService);
    final TaxCategoryDraft withoutKeyDraft = TaxCategoryDraftBuilder.of(null, emptyList(), null).build();
    final TaxCategorySyncStatistics result = sync.sync(asList(null, withoutKeyDraft)).toCompletableFuture().join();
    assertAll(() -> assertThat(result.getProcessed().get()).isEqualTo(2), () -> assertThat(result.getFailed().get()).isEqualTo(2), () -> assertThat(errors).hasSize(2), () -> assertThat(errors).contains("TaxCategoryDraft is null.", "TaxCategoryDraft with name: null doesn't have a key. " + "Please make sure all tax category drafts have keys."));
    verifyNoMoreInteractions(taxCategoryService);
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Optional.empty(java.util.Optional.empty) TaxCategorySyncStatistics(com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics) TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) CompletableFuture.completedFuture(java.util.concurrent.CompletableFuture.completedFuture) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) AtomicReference(java.util.concurrent.atomic.AtomicReference) Collections.singletonList(java.util.Collections.singletonList) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) Arrays.asList(java.util.Arrays.asList) Assertions.as(org.assertj.core.api.Assertions.as) CompletableFuture.supplyAsync(java.util.concurrent.CompletableFuture.supplyAsync) SphereClient(io.sphere.sdk.client.SphereClient) SphereException(io.sphere.sdk.models.SphereException) TaxCategoryService(com.commercetools.sync.services.TaxCategoryService) Assertions.assertAll(org.junit.jupiter.api.Assertions.assertAll) TaxCategoryDraftBuilder(io.sphere.sdk.taxcategories.TaxCategoryDraftBuilder) CountryCode(com.neovisionaries.i18n.CountryCode) Collections.emptySet(java.util.Collections.emptySet) Collections.emptyList(java.util.Collections.emptyList) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) String.format(java.lang.String.format) Mockito.verify(org.mockito.Mockito.verify) Test(org.junit.jupiter.api.Test) List(java.util.List) AfterEach(org.junit.jupiter.api.AfterEach) TaxRateDraftBuilder(io.sphere.sdk.taxcategories.TaxRateDraftBuilder) ConcurrentModificationException(io.sphere.sdk.client.ConcurrentModificationException) Optional(java.util.Optional) STRING(org.assertj.core.api.InstanceOfAssertFactories.STRING) Mockito.reset(org.mockito.Mockito.reset) Mockito.mock(org.mockito.Mockito.mock) TaxCategory(io.sphere.sdk.taxcategories.TaxCategory) TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) TaxCategorySyncStatistics(com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics) SphereClient(io.sphere.sdk.client.SphereClient) ArrayList(java.util.ArrayList) Test(org.junit.jupiter.api.Test)

Example 14 with TaxCategoryService

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

the class TaxCategorySyncTest method sync_WithNoError_ShouldApplyBeforeCreateCallbackAndIncrementCreated.

@Test
void sync_WithNoError_ShouldApplyBeforeCreateCallbackAndIncrementCreated() {
    final AtomicBoolean callbackApplied = new AtomicBoolean(false);
    final TaxCategorySyncOptions options = TaxCategorySyncOptionsBuilder.of(mock(SphereClient.class)).beforeCreateCallback((draft) -> {
        callbackApplied.set(true);
        return draft;
    }).build();
    final TaxCategorySync sync = new TaxCategorySync(options, taxCategoryService);
    final TaxCategoryDraft draft = TaxCategoryDraftBuilder.of("someName", emptyList(), null).key("someKey").build();
    final TaxCategory taxCategory = mock(TaxCategory.class);
    when(taxCategoryService.fetchMatchingTaxCategoriesByKeys(any())).thenReturn(completedFuture(emptySet()));
    when(taxCategoryService.createTaxCategory(any())).thenReturn(completedFuture(Optional.of(taxCategory)));
    final TaxCategorySyncStatistics result = sync.sync(singletonList(draft)).toCompletableFuture().join();
    assertAll(() -> assertThat(result.getProcessed().get()).isEqualTo(1), () -> assertThat(result.getCreated().get()).isEqualTo(1), () -> assertThat(result.getFailed().get()).isEqualTo(0), () -> assertThat(callbackApplied.get()).isTrue());
    verify(taxCategoryService, times(1)).fetchMatchingTaxCategoriesByKeys(any());
    verify(taxCategoryService, times(1)).createTaxCategory(any());
    verifyNoMoreInteractions(taxCategoryService);
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Optional.empty(java.util.Optional.empty) TaxCategorySyncStatistics(com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics) TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) CompletableFuture.completedFuture(java.util.concurrent.CompletableFuture.completedFuture) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) AtomicReference(java.util.concurrent.atomic.AtomicReference) Collections.singletonList(java.util.Collections.singletonList) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) Arrays.asList(java.util.Arrays.asList) Assertions.as(org.assertj.core.api.Assertions.as) CompletableFuture.supplyAsync(java.util.concurrent.CompletableFuture.supplyAsync) SphereClient(io.sphere.sdk.client.SphereClient) SphereException(io.sphere.sdk.models.SphereException) TaxCategoryService(com.commercetools.sync.services.TaxCategoryService) Assertions.assertAll(org.junit.jupiter.api.Assertions.assertAll) TaxCategoryDraftBuilder(io.sphere.sdk.taxcategories.TaxCategoryDraftBuilder) CountryCode(com.neovisionaries.i18n.CountryCode) Collections.emptySet(java.util.Collections.emptySet) Collections.emptyList(java.util.Collections.emptyList) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) String.format(java.lang.String.format) Mockito.verify(org.mockito.Mockito.verify) Test(org.junit.jupiter.api.Test) List(java.util.List) AfterEach(org.junit.jupiter.api.AfterEach) TaxRateDraftBuilder(io.sphere.sdk.taxcategories.TaxRateDraftBuilder) ConcurrentModificationException(io.sphere.sdk.client.ConcurrentModificationException) Optional(java.util.Optional) STRING(org.assertj.core.api.InstanceOfAssertFactories.STRING) Mockito.reset(org.mockito.Mockito.reset) Mockito.mock(org.mockito.Mockito.mock) TaxCategory(io.sphere.sdk.taxcategories.TaxCategory) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) TaxCategory(io.sphere.sdk.taxcategories.TaxCategory) TaxCategorySyncStatistics(com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics) SphereClient(io.sphere.sdk.client.SphereClient) Test(org.junit.jupiter.api.Test)

Example 15 with TaxCategoryService

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

the class TaxCategorySyncTest method sync_WithNoError_ShouldApplyBeforeUpdateCallbackAndIncrementUpdated.

@Test
void sync_WithNoError_ShouldApplyBeforeUpdateCallbackAndIncrementUpdated() {
    final AtomicBoolean callbackApplied = new AtomicBoolean(false);
    final TaxCategorySyncOptions options = TaxCategorySyncOptionsBuilder.of(mock(SphereClient.class)).beforeUpdateCallback((actions, draft, old) -> {
        callbackApplied.set(true);
        return actions;
    }).build();
    final TaxCategorySync sync = new TaxCategorySync(options, taxCategoryService);
    final TaxCategoryDraft draft = TaxCategoryDraftBuilder.of("someName", emptyList(), "changed").key("someKey").build();
    final TaxCategory taxCategory = mock(TaxCategory.class);
    when(taxCategory.getId()).thenReturn("id");
    when(taxCategory.getKey()).thenReturn("someKey");
    when(taxCategoryService.fetchMatchingTaxCategoriesByKeys(any())).thenReturn(completedFuture(new HashSet<>(singletonList(taxCategory))));
    when(taxCategoryService.updateTaxCategory(any(), any())).thenReturn(completedFuture(taxCategory));
    final TaxCategorySyncStatistics result = sync.sync(singletonList(draft)).toCompletableFuture().join();
    assertAll(() -> assertThat(result.getProcessed().get()).isEqualTo(1), () -> assertThat(result.getUpdated().get()).isEqualTo(1), () -> assertThat(result.getFailed().get()).isEqualTo(0), () -> assertThat(callbackApplied.get()).isTrue());
    verify(taxCategoryService, times(1)).fetchMatchingTaxCategoriesByKeys(any());
    verify(taxCategoryService, times(1)).updateTaxCategory(any(), any());
    verifyNoMoreInteractions(taxCategoryService);
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Optional.empty(java.util.Optional.empty) TaxCategorySyncStatistics(com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics) TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) CompletableFuture.completedFuture(java.util.concurrent.CompletableFuture.completedFuture) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) AtomicReference(java.util.concurrent.atomic.AtomicReference) Collections.singletonList(java.util.Collections.singletonList) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) Arrays.asList(java.util.Arrays.asList) Assertions.as(org.assertj.core.api.Assertions.as) CompletableFuture.supplyAsync(java.util.concurrent.CompletableFuture.supplyAsync) SphereClient(io.sphere.sdk.client.SphereClient) SphereException(io.sphere.sdk.models.SphereException) TaxCategoryService(com.commercetools.sync.services.TaxCategoryService) Assertions.assertAll(org.junit.jupiter.api.Assertions.assertAll) TaxCategoryDraftBuilder(io.sphere.sdk.taxcategories.TaxCategoryDraftBuilder) CountryCode(com.neovisionaries.i18n.CountryCode) Collections.emptySet(java.util.Collections.emptySet) Collections.emptyList(java.util.Collections.emptyList) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) String.format(java.lang.String.format) Mockito.verify(org.mockito.Mockito.verify) Test(org.junit.jupiter.api.Test) List(java.util.List) AfterEach(org.junit.jupiter.api.AfterEach) TaxRateDraftBuilder(io.sphere.sdk.taxcategories.TaxRateDraftBuilder) ConcurrentModificationException(io.sphere.sdk.client.ConcurrentModificationException) Optional(java.util.Optional) STRING(org.assertj.core.api.InstanceOfAssertFactories.STRING) Mockito.reset(org.mockito.Mockito.reset) Mockito.mock(org.mockito.Mockito.mock) TaxCategory(io.sphere.sdk.taxcategories.TaxCategory) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) TaxCategory(io.sphere.sdk.taxcategories.TaxCategory) TaxCategorySyncStatistics(com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics) SphereClient(io.sphere.sdk.client.SphereClient) HashSet(java.util.HashSet) Test(org.junit.jupiter.api.Test)

Aggregations

TaxCategoryService (com.commercetools.sync.services.TaxCategoryService)17 SphereClient (io.sphere.sdk.client.SphereClient)16 TaxCategory (io.sphere.sdk.taxcategories.TaxCategory)16 TaxCategoryDraft (io.sphere.sdk.taxcategories.TaxCategoryDraft)16 TaxCategoryDraftBuilder (io.sphere.sdk.taxcategories.TaxCategoryDraftBuilder)16 ArrayList (java.util.ArrayList)16 Collections.singletonList (java.util.Collections.singletonList)16 HashSet (java.util.HashSet)16 List (java.util.List)16 Optional (java.util.Optional)16 Assertions.as (org.assertj.core.api.Assertions.as)16 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)16 STRING (org.assertj.core.api.InstanceOfAssertFactories.STRING)16 Test (org.junit.jupiter.api.Test)16 ArgumentMatchers.any (org.mockito.ArgumentMatchers.any)16 Mockito.times (org.mockito.Mockito.times)16 Mockito.verify (org.mockito.Mockito.verify)16 Mockito.when (org.mockito.Mockito.when)16 TaxCategorySyncStatistics (com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics)11 CountryCode (com.neovisionaries.i18n.CountryCode)11