Search in sources :

Example 1 with TaxCategorySyncOptions

use of com.commercetools.sync.taxcategories.TaxCategorySyncOptions 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 TaxCategorySyncOptions

use of com.commercetools.sync.taxcategories.TaxCategorySyncOptions 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 TaxCategorySyncOptions

use of com.commercetools.sync.taxcategories.TaxCategorySyncOptions 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 TaxCategorySyncOptions

use of com.commercetools.sync.taxcategories.TaxCategorySyncOptions 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 TaxCategorySyncOptions

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

the class TaxCategoryServiceImplIT method fetchMatchingTaxCategoriesByKeys_WithBadGateWayExceptionAlways_ShouldFail.

@Test
void fetchMatchingTaxCategoriesByKeys_WithBadGateWayExceptionAlways_ShouldFail() {
    // Mock sphere client to return BadGatewayException on any request.
    final SphereClient spyClient = spy(CTP_TARGET_CLIENT);
    when(spyClient.execute(any(TaxCategoryQuery.class))).thenReturn(CompletableFutureUtils.exceptionallyCompletedFuture(new BadGatewayException())).thenCallRealMethod();
    final TaxCategorySyncOptions spyOptions = TaxCategorySyncOptionsBuilder.of(spyClient).errorCallback((exception, oldResource, newResource, updateActions) -> {
        errorCallBackMessages.add(exception.getMessage());
        errorCallBackExceptions.add(exception.getCause());
    }).build();
    final TaxCategoryService spyTaxCategoryService = new TaxCategoryServiceImpl(spyOptions);
    final Set<String> keys = new HashSet<>();
    keys.add(TAXCATEGORY_KEY);
    // test and assert
    assertThat(errorCallBackExceptions).isEmpty();
    assertThat(errorCallBackMessages).isEmpty();
    assertThat(spyTaxCategoryService.fetchMatchingTaxCategoriesByKeys(keys)).failsWithin(10, TimeUnit.SECONDS).withThrowableOfType(ExecutionException.class).withCauseExactlyInstanceOf(BadGatewayException.class);
}
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) TaxCategorySyncOptions(com.commercetools.sync.taxcategories.TaxCategorySyncOptions) SphereClient(io.sphere.sdk.client.SphereClient) TaxCategoryService(com.commercetools.sync.services.TaxCategoryService) BadGatewayException(io.sphere.sdk.client.BadGatewayException) ExecutionException(java.util.concurrent.ExecutionException) HashSet(java.util.HashSet) Test(org.junit.jupiter.api.Test)

Aggregations

TaxCategorySyncOptions (com.commercetools.sync.taxcategories.TaxCategorySyncOptions)13 TaxCategoryDraft (io.sphere.sdk.taxcategories.TaxCategoryDraft)13 Test (org.junit.jupiter.api.Test)12 TaxCategory (io.sphere.sdk.taxcategories.TaxCategory)11 TaxCategorySyncOptionsBuilder (com.commercetools.sync.taxcategories.TaxCategorySyncOptionsBuilder)10 SphereClient (io.sphere.sdk.client.SphereClient)10 TaxCategoryDraftBuilder (io.sphere.sdk.taxcategories.TaxCategoryDraftBuilder)10 TaxCategoryQuery (io.sphere.sdk.taxcategories.queries.TaxCategoryQuery)10 List (java.util.List)10 Optional (java.util.Optional)10 CTP_TARGET_CLIENT (com.commercetools.sync.integration.commons.utils.SphereClientUtils.CTP_TARGET_CLIENT)8 TaxCategoryITUtils.deleteTaxCategories (com.commercetools.sync.integration.commons.utils.TaxCategoryITUtils.deleteTaxCategories)8 CompletionStageUtil.executeBlocking (com.commercetools.tests.utils.CompletionStageUtil.executeBlocking)8 BadGatewayException (io.sphere.sdk.client.BadGatewayException)8 CompletableFutureUtils (io.sphere.sdk.utils.CompletableFutureUtils)8 ArrayList (java.util.ArrayList)8 BeforeEach (org.junit.jupiter.api.BeforeEach)8 ArgumentMatchers.any (org.mockito.ArgumentMatchers.any)8 Mockito.when (org.mockito.Mockito.when)8 TaxCategorySync (com.commercetools.sync.taxcategories.TaxCategorySync)7