Search in sources :

Example 1 with TaxCategorySyncStatistics

use of com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics in project commercetools-sync-java by commercetools.

the class TaxCategorySyncIT method sync_WithUpdatedTaxCategory_ShouldUpdateTaxCategory.

@Test
void sync_WithUpdatedTaxCategory_ShouldUpdateTaxCategory() {
    // preparation
    final SubRate subRate1 = SubRate.of("subRate-1", 0.07);
    final SubRate subRate2 = SubRate.of("subRate-2", 0.09);
    final TaxRateDraft taxRateDraft = TaxRateDraftBuilder.of("%16 VAT", 0.16, true, CountryCode.DE).subRates(asList(subRate1, subRate2)).build();
    final TaxCategoryDraft taxCategoryDraft = TaxCategoryDraftBuilder.of("tax-category-name-updated", singletonList(taxRateDraft), "tax-category-description-updated").key("tax-category-key").build();
    final TaxCategorySyncOptions taxCategorySyncOptions = TaxCategorySyncOptionsBuilder.of(CTP_TARGET_CLIENT).build();
    final TaxCategorySync taxCategorySync = new TaxCategorySync(taxCategorySyncOptions);
    // test
    final TaxCategorySyncStatistics taxCategorySyncStatistics = taxCategorySync.sync(singletonList(taxCategoryDraft)).toCompletableFuture().join();
    // assertion
    assertThat(taxCategorySyncStatistics).hasValues(1, 0, 1, 0);
    final Optional<TaxCategory> oldTaxCategoryAfter = getTaxCategoryByKey(CTP_TARGET_CLIENT, "tax-category-key");
    Assertions.assertThat(oldTaxCategoryAfter).hasValueSatisfying(taxCategory -> {
        Assertions.assertThat(taxCategory.getName()).isEqualTo("tax-category-name-updated");
        Assertions.assertThat(taxCategory.getDescription()).isEqualTo("tax-category-description-updated");
        final TaxRate taxRate = taxCategory.getTaxRates().get(0);
        Assertions.assertThat(taxRate.getName()).isEqualTo("%16 VAT");
        Assertions.assertThat(taxRate.getAmount()).isEqualTo(0.16);
        Assertions.assertThat(taxRate.getCountry()).isEqualTo(CountryCode.DE);
        Assertions.assertThat(taxRate.isIncludedInPrice()).isEqualTo(true);
        Assertions.assertThat(taxRate.getSubRates()).isEqualTo(asList(subRate1, subRate2));
    });
}
Also used : TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) TaxCategorySync(com.commercetools.sync.taxcategories.TaxCategorySync) TaxCategorySyncOptions(com.commercetools.sync.taxcategories.TaxCategorySyncOptions) TaxCategorySyncStatistics(com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics) TaxCategory(io.sphere.sdk.taxcategories.TaxCategory) SubRate(io.sphere.sdk.taxcategories.SubRate) TaxRate(io.sphere.sdk.taxcategories.TaxRate) TaxRateDraft(io.sphere.sdk.taxcategories.TaxRateDraft) Test(org.junit.jupiter.api.Test)

Example 2 with TaxCategorySyncStatistics

use of com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics in project commercetools-sync-java by commercetools.

the class TaxCategorySyncIT method sync_withChangedTaxCategoryButConcurrentModificationException_shouldRetryAndUpdateTaxCategory.

@Test
void sync_withChangedTaxCategoryButConcurrentModificationException_shouldRetryAndUpdateTaxCategory() {
    // preparation
    final SphereClient spyClient = buildClientWithConcurrentModificationUpdate();
    List<String> errorCallBackMessages = new ArrayList<>();
    List<String> warningCallBackMessages = new ArrayList<>();
    List<Throwable> errorCallBackExceptions = new ArrayList<>();
    final TaxCategorySyncOptions spyOptions = TaxCategorySyncOptionsBuilder.of(spyClient).errorCallback((exception, oldResource, newResource, updateActions) -> {
        errorCallBackMessages.add(exception.getMessage());
        errorCallBackExceptions.add(exception.getCause());
    }).build();
    final TaxCategorySync taxCategorySync = new TaxCategorySync(spyOptions);
    final TaxCategoryDraft taxCategoryDraft = TaxCategoryDraftBuilder.of("tax-category-name-updated", null, "tax-category-description-updated").key("tax-category-key").build();
    // test
    final TaxCategorySyncStatistics taxCategorySyncStatistics = taxCategorySync.sync(singletonList(taxCategoryDraft)).toCompletableFuture().join();
    assertThat(taxCategorySyncStatistics).hasValues(1, 0, 1, 0);
    Assertions.assertThat(errorCallBackExceptions).isEmpty();
    Assertions.assertThat(errorCallBackMessages).isEmpty();
    Assertions.assertThat(warningCallBackMessages).isEmpty();
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) BeforeEach(org.junit.jupiter.api.BeforeEach) TaxCategorySync(com.commercetools.sync.taxcategories.TaxCategorySync) TaxCategorySyncStatistics(com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics) TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) AssertionsForStatistics.assertThat(com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics.assertThat) TaxCategoryQuery(io.sphere.sdk.taxcategories.queries.TaxCategoryQuery) CompletableFuture(java.util.concurrent.CompletableFuture) Mockito.spy(org.mockito.Mockito.spy) CompletableFutureUtils(io.sphere.sdk.utils.CompletableFutureUtils) Collections.singletonList(java.util.Collections.singletonList) ArrayList(java.util.ArrayList) TaxCategoryITUtils.getTaxCategoryByKey(com.commercetools.sync.integration.commons.utils.TaxCategoryITUtils.getTaxCategoryByKey) AfterAll(org.junit.jupiter.api.AfterAll) TaxRateDraft(io.sphere.sdk.taxcategories.TaxRateDraft) SubRate(io.sphere.sdk.taxcategories.SubRate) Arrays.asList(java.util.Arrays.asList) SphereClient(io.sphere.sdk.client.SphereClient) Assertions(org.assertj.core.api.Assertions) Nonnull(javax.annotation.Nonnull) TaxCategoryDraftBuilder(io.sphere.sdk.taxcategories.TaxCategoryDraftBuilder) CountryCode(com.neovisionaries.i18n.CountryCode) BadGatewayException(io.sphere.sdk.client.BadGatewayException) TaxRate(io.sphere.sdk.taxcategories.TaxRate) TaxCategorySyncOptionsBuilder(com.commercetools.sync.taxcategories.TaxCategorySyncOptionsBuilder) TaxCategoryUpdateCommand(io.sphere.sdk.taxcategories.commands.TaxCategoryUpdateCommand) CompletionStageUtil.executeBlocking(com.commercetools.tests.utils.CompletionStageUtil.executeBlocking) Mockito.when(org.mockito.Mockito.when) String.format(java.lang.String.format) Test(org.junit.jupiter.api.Test) List(java.util.List) TaxCategorySyncOptions(com.commercetools.sync.taxcategories.TaxCategorySyncOptions) TaxRateDraftBuilder(io.sphere.sdk.taxcategories.TaxRateDraftBuilder) PagedQueryResult(io.sphere.sdk.queries.PagedQueryResult) ConcurrentModificationException(io.sphere.sdk.client.ConcurrentModificationException) TaxCategoryCreateCommand(io.sphere.sdk.taxcategories.commands.TaxCategoryCreateCommand) Optional(java.util.Optional) TaxCategoryITUtils.deleteTaxCategories(com.commercetools.sync.integration.commons.utils.TaxCategoryITUtils.deleteTaxCategories) CTP_TARGET_CLIENT(com.commercetools.sync.integration.commons.utils.SphereClientUtils.CTP_TARGET_CLIENT) TaxCategory(io.sphere.sdk.taxcategories.TaxCategory) TaxCategorySync(com.commercetools.sync.taxcategories.TaxCategorySync) TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) TaxCategorySyncOptions(com.commercetools.sync.taxcategories.TaxCategorySyncOptions) TaxCategorySyncStatistics(com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics) SphereClient(io.sphere.sdk.client.SphereClient) ArrayList(java.util.ArrayList) Test(org.junit.jupiter.api.Test)

Example 3 with TaxCategorySyncStatistics

use of com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics in project commercetools-sync-java by commercetools.

the class TaxCategorySyncIT method sync_WithConcurrentModificationExceptionAndFailedFetch_ShouldFailToReFetchAndUpdate.

@Test
void sync_WithConcurrentModificationExceptionAndFailedFetch_ShouldFailToReFetchAndUpdate() {
    // preparation
    final SphereClient spyClient = buildClientWithConcurrentModificationUpdateAndFailedFetchOnRetry();
    List<String> errorCallBackMessages = new ArrayList<>();
    List<Throwable> errorCallBackExceptions = new ArrayList<>();
    final TaxCategorySyncOptions spyOptions = TaxCategorySyncOptionsBuilder.of(spyClient).errorCallback((exception, oldResource, newResource, updateActions) -> {
        errorCallBackMessages.add(exception.getMessage());
        errorCallBackExceptions.add(exception.getCause());
    }).build();
    final TaxCategorySync taxCategorySync = new TaxCategorySync(spyOptions);
    final TaxCategoryDraft taxCategoryDraft = TaxCategoryDraftBuilder.of("tax-category-name-updated", null, "tax-category-description-updated").key("tax-category-key").build();
    // test
    final TaxCategorySyncStatistics taxCategorySyncStatistics = taxCategorySync.sync(singletonList(taxCategoryDraft)).toCompletableFuture().join();
    // Test and assertion
    assertThat(taxCategorySyncStatistics).hasValues(1, 0, 0, 1);
    Assertions.assertThat(errorCallBackMessages).hasSize(1);
    Assertions.assertThat(errorCallBackExceptions).hasSize(1);
    Assertions.assertThat(errorCallBackExceptions.get(0).getCause()).isExactlyInstanceOf(BadGatewayException.class);
    Assertions.assertThat(errorCallBackMessages.get(0)).contains(format("Failed to update tax category with key: '%s'. Reason: Failed to fetch from CTP while retrying " + "after concurrency modification.", taxCategoryDraft.getKey()));
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) BeforeEach(org.junit.jupiter.api.BeforeEach) TaxCategorySync(com.commercetools.sync.taxcategories.TaxCategorySync) TaxCategorySyncStatistics(com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics) TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) AssertionsForStatistics.assertThat(com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics.assertThat) TaxCategoryQuery(io.sphere.sdk.taxcategories.queries.TaxCategoryQuery) CompletableFuture(java.util.concurrent.CompletableFuture) Mockito.spy(org.mockito.Mockito.spy) CompletableFutureUtils(io.sphere.sdk.utils.CompletableFutureUtils) Collections.singletonList(java.util.Collections.singletonList) ArrayList(java.util.ArrayList) TaxCategoryITUtils.getTaxCategoryByKey(com.commercetools.sync.integration.commons.utils.TaxCategoryITUtils.getTaxCategoryByKey) AfterAll(org.junit.jupiter.api.AfterAll) TaxRateDraft(io.sphere.sdk.taxcategories.TaxRateDraft) SubRate(io.sphere.sdk.taxcategories.SubRate) Arrays.asList(java.util.Arrays.asList) SphereClient(io.sphere.sdk.client.SphereClient) Assertions(org.assertj.core.api.Assertions) Nonnull(javax.annotation.Nonnull) TaxCategoryDraftBuilder(io.sphere.sdk.taxcategories.TaxCategoryDraftBuilder) CountryCode(com.neovisionaries.i18n.CountryCode) BadGatewayException(io.sphere.sdk.client.BadGatewayException) TaxRate(io.sphere.sdk.taxcategories.TaxRate) TaxCategorySyncOptionsBuilder(com.commercetools.sync.taxcategories.TaxCategorySyncOptionsBuilder) TaxCategoryUpdateCommand(io.sphere.sdk.taxcategories.commands.TaxCategoryUpdateCommand) CompletionStageUtil.executeBlocking(com.commercetools.tests.utils.CompletionStageUtil.executeBlocking) Mockito.when(org.mockito.Mockito.when) String.format(java.lang.String.format) Test(org.junit.jupiter.api.Test) List(java.util.List) TaxCategorySyncOptions(com.commercetools.sync.taxcategories.TaxCategorySyncOptions) TaxRateDraftBuilder(io.sphere.sdk.taxcategories.TaxRateDraftBuilder) PagedQueryResult(io.sphere.sdk.queries.PagedQueryResult) ConcurrentModificationException(io.sphere.sdk.client.ConcurrentModificationException) TaxCategoryCreateCommand(io.sphere.sdk.taxcategories.commands.TaxCategoryCreateCommand) Optional(java.util.Optional) TaxCategoryITUtils.deleteTaxCategories(com.commercetools.sync.integration.commons.utils.TaxCategoryITUtils.deleteTaxCategories) CTP_TARGET_CLIENT(com.commercetools.sync.integration.commons.utils.SphereClientUtils.CTP_TARGET_CLIENT) TaxCategory(io.sphere.sdk.taxcategories.TaxCategory) TaxCategorySync(com.commercetools.sync.taxcategories.TaxCategorySync) TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) TaxCategorySyncOptions(com.commercetools.sync.taxcategories.TaxCategorySyncOptions) TaxCategorySyncStatistics(com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics) SphereClient(io.sphere.sdk.client.SphereClient) ArrayList(java.util.ArrayList) Test(org.junit.jupiter.api.Test)

Example 4 with TaxCategorySyncStatistics

use of com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics in project commercetools-sync-java by commercetools.

the class TaxCategorySyncIT method sync_WithConcurrentModificationExceptionAndUnexpectedDelete_ShouldFailToReFetchAndUpdate.

@Test
void sync_WithConcurrentModificationExceptionAndUnexpectedDelete_ShouldFailToReFetchAndUpdate() {
    // preparation
    final SphereClient spyClient = buildClientWithConcurrentModificationUpdateAndNotFoundFetchOnRetry();
    List<String> errorCallBackMessages = new ArrayList<>();
    List<Throwable> errorCallBackExceptions = new ArrayList<>();
    final TaxCategorySyncOptions spyOptions = TaxCategorySyncOptionsBuilder.of(spyClient).errorCallback((exception, oldResource, newResource, updateActions) -> {
        errorCallBackMessages.add(exception.getMessage());
        errorCallBackExceptions.add(exception.getCause());
    }).build();
    final TaxCategorySync taxCategorySync = new TaxCategorySync(spyOptions);
    final TaxCategoryDraft taxCategoryDraft = TaxCategoryDraftBuilder.of("tax-category-name-updated", null, "tax-category-description-updated").key("tax-category-key").build();
    final TaxCategorySyncStatistics taxCategorySyncStatistics = taxCategorySync.sync(singletonList(taxCategoryDraft)).toCompletableFuture().join();
    // Test and assertion
    assertThat(taxCategorySyncStatistics).hasValues(1, 0, 0, 1);
    Assertions.assertThat(errorCallBackMessages).hasSize(1);
    Assertions.assertThat(errorCallBackExceptions).hasSize(1);
    Assertions.assertThat(errorCallBackMessages.get(0)).contains(format("Failed to update tax category with key: '%s'. Reason: Not found when attempting to fetch while" + " retrying after concurrency modification.", taxCategoryDraft.getKey()));
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) BeforeEach(org.junit.jupiter.api.BeforeEach) TaxCategorySync(com.commercetools.sync.taxcategories.TaxCategorySync) TaxCategorySyncStatistics(com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics) TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) AssertionsForStatistics.assertThat(com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics.assertThat) TaxCategoryQuery(io.sphere.sdk.taxcategories.queries.TaxCategoryQuery) CompletableFuture(java.util.concurrent.CompletableFuture) Mockito.spy(org.mockito.Mockito.spy) CompletableFutureUtils(io.sphere.sdk.utils.CompletableFutureUtils) Collections.singletonList(java.util.Collections.singletonList) ArrayList(java.util.ArrayList) TaxCategoryITUtils.getTaxCategoryByKey(com.commercetools.sync.integration.commons.utils.TaxCategoryITUtils.getTaxCategoryByKey) AfterAll(org.junit.jupiter.api.AfterAll) TaxRateDraft(io.sphere.sdk.taxcategories.TaxRateDraft) SubRate(io.sphere.sdk.taxcategories.SubRate) Arrays.asList(java.util.Arrays.asList) SphereClient(io.sphere.sdk.client.SphereClient) Assertions(org.assertj.core.api.Assertions) Nonnull(javax.annotation.Nonnull) TaxCategoryDraftBuilder(io.sphere.sdk.taxcategories.TaxCategoryDraftBuilder) CountryCode(com.neovisionaries.i18n.CountryCode) BadGatewayException(io.sphere.sdk.client.BadGatewayException) TaxRate(io.sphere.sdk.taxcategories.TaxRate) TaxCategorySyncOptionsBuilder(com.commercetools.sync.taxcategories.TaxCategorySyncOptionsBuilder) TaxCategoryUpdateCommand(io.sphere.sdk.taxcategories.commands.TaxCategoryUpdateCommand) CompletionStageUtil.executeBlocking(com.commercetools.tests.utils.CompletionStageUtil.executeBlocking) Mockito.when(org.mockito.Mockito.when) String.format(java.lang.String.format) Test(org.junit.jupiter.api.Test) List(java.util.List) TaxCategorySyncOptions(com.commercetools.sync.taxcategories.TaxCategorySyncOptions) TaxRateDraftBuilder(io.sphere.sdk.taxcategories.TaxRateDraftBuilder) PagedQueryResult(io.sphere.sdk.queries.PagedQueryResult) ConcurrentModificationException(io.sphere.sdk.client.ConcurrentModificationException) TaxCategoryCreateCommand(io.sphere.sdk.taxcategories.commands.TaxCategoryCreateCommand) Optional(java.util.Optional) TaxCategoryITUtils.deleteTaxCategories(com.commercetools.sync.integration.commons.utils.TaxCategoryITUtils.deleteTaxCategories) CTP_TARGET_CLIENT(com.commercetools.sync.integration.commons.utils.SphereClientUtils.CTP_TARGET_CLIENT) TaxCategory(io.sphere.sdk.taxcategories.TaxCategory) TaxCategorySync(com.commercetools.sync.taxcategories.TaxCategorySync) TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) TaxCategorySyncOptions(com.commercetools.sync.taxcategories.TaxCategorySyncOptions) TaxCategorySyncStatistics(com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics) SphereClient(io.sphere.sdk.client.SphereClient) ArrayList(java.util.ArrayList) Test(org.junit.jupiter.api.Test)

Example 5 with TaxCategorySyncStatistics

use of com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics in project commercetools-sync-java by commercetools.

the class TaxCategorySyncTest method sync_WithErrorFetchingExistingKeys_ShouldApplyErrorCallbackAndIncrementFailed.

@Test
void sync_WithErrorFetchingExistingKeys_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 draft = TaxCategoryDraftBuilder.of("someName", emptyList(), null).key("someKey").build();
    when(taxCategoryService.fetchMatchingTaxCategoriesByKeys(any())).thenReturn(supplyAsync(() -> {
        throw new SphereException();
    }));
    final TaxCategorySyncStatistics result = sync.sync(singletonList(draft)).toCompletableFuture().join();
    assertAll(() -> assertThat(result.getProcessed().get()).isEqualTo(1), () -> assertThat(errors).hasSize(1), () -> assertThat(errors).contains("Failed to fetch existing tax categories with keys: '[someKey]'."));
    verify(taxCategoryService, times(1)).fetchMatchingTaxCategoriesByKeys(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) TaxCategoryDraft(io.sphere.sdk.taxcategories.TaxCategoryDraft) TaxCategorySyncStatistics(com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics) SphereClient(io.sphere.sdk.client.SphereClient) ArrayList(java.util.ArrayList) SphereException(io.sphere.sdk.models.SphereException) Test(org.junit.jupiter.api.Test)

Aggregations

TaxCategorySyncStatistics (com.commercetools.sync.taxcategories.helpers.TaxCategorySyncStatistics)17 TaxCategoryDraft (io.sphere.sdk.taxcategories.TaxCategoryDraft)17 Test (org.junit.jupiter.api.Test)17 TaxCategory (io.sphere.sdk.taxcategories.TaxCategory)15 CountryCode (com.neovisionaries.i18n.CountryCode)14 ConcurrentModificationException (io.sphere.sdk.client.ConcurrentModificationException)14 SphereClient (io.sphere.sdk.client.SphereClient)14 TaxCategoryDraftBuilder (io.sphere.sdk.taxcategories.TaxCategoryDraftBuilder)14 TaxRateDraftBuilder (io.sphere.sdk.taxcategories.TaxRateDraftBuilder)14 String.format (java.lang.String.format)14 ArrayList (java.util.ArrayList)14 Arrays.asList (java.util.Arrays.asList)14 Collections.singletonList (java.util.Collections.singletonList)14 List (java.util.List)14 Optional (java.util.Optional)14 ArgumentMatchers.any (org.mockito.ArgumentMatchers.any)14 Mockito.when (org.mockito.Mockito.when)14 TaxCategoryService (com.commercetools.sync.services.TaxCategoryService)11 SphereException (io.sphere.sdk.models.SphereException)11 Collections.emptyList (java.util.Collections.emptyList)11