Search in sources :

Example 1 with AssertionsForStatistics.assertThat

use of com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics.assertThat in project commercetools-sync-java by commercetools.

the class CartDiscountSyncTest method sync_WithFailOnCachingKeysToIds_ShouldTriggerErrorCallbackAndReturnProperStats.

@Test
void sync_WithFailOnCachingKeysToIds_ShouldTriggerErrorCallbackAndReturnProperStats() {
    // preparation
    final List<String> errorMessages = new ArrayList<>();
    final List<Throwable> exceptions = new ArrayList<>();
    final CartDiscountSyncOptions cartDiscountSyncOptions = CartDiscountSyncOptionsBuilder.of(mock(SphereClient.class)).errorCallback((exception, oldResource, newResource, actions) -> {
        errorMessages.add(exception.getMessage());
        exceptions.add(exception.getCause());
    }).build();
    final TypeService typeService = spy(new TypeServiceImpl(cartDiscountSyncOptions));
    when(typeService.cacheKeysToIds(anySet())).thenReturn(supplyAsync(() -> {
        throw new SphereException();
    }));
    final CartDiscountSync cartDiscountSync = new CartDiscountSync(cartDiscountSyncOptions, typeService, mock(CartDiscountService.class));
    final CartDiscountDraft newCartDiscountDraftWithCustomType = mock(CartDiscountDraft.class);
    when(newCartDiscountDraftWithCustomType.getKey()).thenReturn("cart-discount-key");
    when(newCartDiscountDraftWithCustomType.getCustom()).thenReturn(CustomFieldsDraft.ofTypeKeyAndJson("typeKey", emptyMap()));
    // test
    final CartDiscountSyncStatistics cartDiscountSyncStatistics = cartDiscountSync.sync(singletonList(newCartDiscountDraftWithCustomType)).toCompletableFuture().join();
    // assertions
    AssertionsForStatistics.assertThat(cartDiscountSyncStatistics).hasValues(1, 0, 0, 1);
    assertThat(errorMessages).hasSize(1).singleElement(as(STRING)).contains("Failed to build a cache of keys to ids.");
    assertThat(exceptions).hasSize(1).singleElement().matches(throwable -> {
        assertThat(throwable).isExactlyInstanceOf(CompletionException.class);
        assertThat(throwable).hasCauseExactlyInstanceOf(SphereException.class);
        return true;
    });
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) ArgumentMatchers.anySet(org.mockito.ArgumentMatchers.anySet) SyncException(com.commercetools.sync.commons.exceptions.SyncException) CartDiscount(io.sphere.sdk.cartdiscounts.CartDiscount) CompletableFuture.completedFuture(java.util.concurrent.CompletableFuture.completedFuture) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) CartPredicate(io.sphere.sdk.cartdiscounts.CartPredicate) ZonedDateTime(java.time.ZonedDateTime) AssertionsForStatistics.assertThat(com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics.assertThat) Mockito.spy(org.mockito.Mockito.spy) Collections.singletonList(java.util.Collections.singletonList) ArrayList(java.util.ArrayList) CartDiscountService(com.commercetools.sync.services.CartDiscountService) CartDiscountDraftBuilder(io.sphere.sdk.cartdiscounts.CartDiscountDraftBuilder) CartDiscountSyncStatistics(com.commercetools.sync.cartdiscounts.helpers.CartDiscountSyncStatistics) Collections.singleton(java.util.Collections.singleton) BeforeAll(org.junit.jupiter.api.BeforeAll) Assertions.as(org.assertj.core.api.Assertions.as) Locale(java.util.Locale) CompletableFuture.supplyAsync(java.util.concurrent.CompletableFuture.supplyAsync) TypeService(com.commercetools.sync.services.TypeService) SphereClient(io.sphere.sdk.client.SphereClient) SphereException(io.sphere.sdk.models.SphereException) CartDiscountDraft(io.sphere.sdk.cartdiscounts.CartDiscountDraft) Collections.emptyMap(java.util.Collections.emptyMap) CartDiscountValue(io.sphere.sdk.cartdiscounts.CartDiscountValue) Collections.emptySet(java.util.Collections.emptySet) CompletionException(java.util.concurrent.CompletionException) Mockito.when(org.mockito.Mockito.when) TypeServiceImpl(com.commercetools.sync.services.impl.TypeServiceImpl) String.format(java.lang.String.format) Mockito.verify(org.mockito.Mockito.verify) Test(org.junit.jupiter.api.Test) LocalizedString(io.sphere.sdk.models.LocalizedString) Mockito.never(org.mockito.Mockito.never) CustomFieldsDraft(io.sphere.sdk.types.CustomFieldsDraft) List(java.util.List) MockUtils.getMockTypeService(com.commercetools.sync.commons.MockUtils.getMockTypeService) Optional(java.util.Optional) STRING(org.assertj.core.api.InstanceOfAssertFactories.STRING) ShippingCostTarget(io.sphere.sdk.cartdiscounts.ShippingCostTarget) AssertionsForStatistics(com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics) Mockito.mock(org.mockito.Mockito.mock) CartDiscountService(com.commercetools.sync.services.CartDiscountService) CartDiscountDraft(io.sphere.sdk.cartdiscounts.CartDiscountDraft) CartDiscountSyncStatistics(com.commercetools.sync.cartdiscounts.helpers.CartDiscountSyncStatistics) ArrayList(java.util.ArrayList) LocalizedString(io.sphere.sdk.models.LocalizedString) TypeServiceImpl(com.commercetools.sync.services.impl.TypeServiceImpl) SphereException(io.sphere.sdk.models.SphereException) SphereClient(io.sphere.sdk.client.SphereClient) TypeService(com.commercetools.sync.services.TypeService) MockUtils.getMockTypeService(com.commercetools.sync.commons.MockUtils.getMockTypeService) Test(org.junit.jupiter.api.Test)

Example 2 with AssertionsForStatistics.assertThat

use of com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics.assertThat in project commercetools-sync-java by commercetools.

the class ProductSyncTest method sync_WithEmptyAttributeMetaDataMap_ShouldCallErrorCallback.

@Test
@SuppressWarnings("unchecked")
void sync_WithEmptyAttributeMetaDataMap_ShouldCallErrorCallback() {
    // preparation
    final ProductDraft productDraft = createProductDraftBuilder(PRODUCT_KEY_1_WITH_PRICES_RESOURCE_PATH, ResourceIdentifier.ofKey("productTypeKey")).taxCategory(null).state(null).build();
    final ProductProjection mockedExistingProduct = readObjectFromResource(PRODUCT_KEY_1_WITH_PRICES_RESOURCE_PATH, Product.class).toProjection(STAGED);
    final List<String> errorMessages = new ArrayList<>();
    final List<Throwable> exceptions = new ArrayList<>();
    final ProductSyncOptions productSyncOptions = ProductSyncOptionsBuilder.of(mock(SphereClient.class)).errorCallback((exception, oldResource, newResource, updateActions) -> {
        errorMessages.add(exception.getMessage());
        exceptions.add(exception.getCause());
    }).build();
    final ProductService productService = mock(ProductService.class);
    final Map<String, String> keyToIds = new HashMap<>();
    keyToIds.put(productDraft.getKey(), UUID.randomUUID().toString());
    when(productService.cacheKeysToIds(anySet())).thenReturn(completedFuture(keyToIds));
    when(productService.fetchMatchingProductsByKeys(anySet())).thenReturn(completedFuture(singleton(mockedExistingProduct)));
    when(productService.updateProduct(any(), any())).thenReturn(completedFuture(mockedExistingProduct));
    final ProductTypeService productTypeService = mock(ProductTypeService.class);
    when(productTypeService.fetchCachedProductTypeId(any())).thenReturn(completedFuture(Optional.of(UUID.randomUUID().toString())));
    when(productTypeService.fetchCachedProductAttributeMetaDataMap(any())).thenReturn(completedFuture(Optional.empty()));
    final CategoryService categoryService = mock(CategoryService.class);
    when(categoryService.fetchMatchingCategoriesByKeys(any())).thenReturn(completedFuture(emptySet()));
    final ProductSyncOptions spyProductSyncOptions = spy(productSyncOptions);
    final ProductSync productSync = new ProductSync(spyProductSyncOptions, productService, productTypeService, categoryService, mock(TypeService.class), mock(ChannelService.class), mock(CustomerGroupService.class), mock(TaxCategoryService.class), mock(StateService.class), mock(UnresolvedReferencesService.class), mock(CustomObjectService.class), mock(CustomerService.class));
    // test
    ProductSyncStatistics productSyncStatistics = productSync.sync(singletonList(productDraft)).toCompletableFuture().join();
    // assertion
    // assertions
    assertThat(errorMessages).hasSize(1).singleElement(as(STRING)).contains("Failed to update Product with key: 'productKey1'. Reason: Failed to" + " fetch a productType for the product to build the products' attributes metadata.");
    AssertionsForStatistics.assertThat(productSyncStatistics).hasValues(1, 0, 0, 1);
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) ArgumentMatchers.anySet(org.mockito.ArgumentMatchers.anySet) ProductProjectionQuery(io.sphere.sdk.products.queries.ProductProjectionQuery) SphereJsonUtils.readObjectFromResource(io.sphere.sdk.json.SphereJsonUtils.readObjectFromResource) PRODUCT_KEY_2_RESOURCE_PATH(com.commercetools.sync.products.ProductSyncMockUtils.PRODUCT_KEY_2_RESOURCE_PATH) STAGED(io.sphere.sdk.products.ProductProjectionType.STAGED) CompletableFuture.completedFuture(java.util.concurrent.CompletableFuture.completedFuture) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) AssertionsForStatistics.assertThat(com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics.assertThat) ProductSyncMockUtils.createProductDraftBuilder(com.commercetools.sync.products.ProductSyncMockUtils.createProductDraftBuilder) HashMap(java.util.HashMap) Mockito.spy(org.mockito.Mockito.spy) Collections.singletonList(java.util.Collections.singletonList) ArrayList(java.util.ArrayList) Collections.singleton(java.util.Collections.singleton) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) Assertions.as(org.assertj.core.api.Assertions.as) CompletableFuture.supplyAsync(java.util.concurrent.CompletableFuture.supplyAsync) Map(java.util.Map) THROWABLE(org.assertj.core.api.InstanceOfAssertFactories.THROWABLE) SphereClient(io.sphere.sdk.client.SphereClient) SphereException(io.sphere.sdk.models.SphereException) ProductDraft(io.sphere.sdk.products.ProductDraft) ProductProjection(io.sphere.sdk.products.ProductProjection) ProductDraftBuilder(io.sphere.sdk.products.ProductDraftBuilder) com.commercetools.sync.services(com.commercetools.sync.services) Collections.emptyMap(java.util.Collections.emptyMap) PRODUCT_KEY_1_WITH_PRICES_RESOURCE_PATH(com.commercetools.sync.products.ProductSyncMockUtils.PRODUCT_KEY_1_WITH_PRICES_RESOURCE_PATH) Collections.emptySet(java.util.Collections.emptySet) Collections.emptyList(java.util.Collections.emptyList) CompletionException(java.util.concurrent.CompletionException) Mockito.when(org.mockito.Mockito.when) Product(io.sphere.sdk.products.Product) UUID(java.util.UUID) Mockito.verify(org.mockito.Mockito.verify) Test(org.junit.jupiter.api.Test) Mockito.never(org.mockito.Mockito.never) ProductServiceImpl(com.commercetools.sync.services.impl.ProductServiceImpl) List(java.util.List) LocalizedString.ofEnglish(io.sphere.sdk.models.LocalizedString.ofEnglish) ProductSyncStatistics(com.commercetools.sync.products.helpers.ProductSyncStatistics) Optional(java.util.Optional) STRING(org.assertj.core.api.InstanceOfAssertFactories.STRING) AssertionsForStatistics(com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics) Mockito.mock(org.mockito.Mockito.mock) ResourceIdentifier(io.sphere.sdk.models.ResourceIdentifier) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Product(io.sphere.sdk.products.Product) ProductProjection(io.sphere.sdk.products.ProductProjection) ProductDraft(io.sphere.sdk.products.ProductDraft) SphereClient(io.sphere.sdk.client.SphereClient) ProductSyncStatistics(com.commercetools.sync.products.helpers.ProductSyncStatistics) Test(org.junit.jupiter.api.Test)

Example 3 with AssertionsForStatistics.assertThat

use of com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics.assertThat in project commercetools-sync-java by commercetools.

the class InventorySyncTest method sync_WithFailOnCachingKeysToIds_ShouldTriggerErrorCallbackAndReturnProperStats.

@Test
void sync_WithFailOnCachingKeysToIds_ShouldTriggerErrorCallbackAndReturnProperStats() {
    // preparation
    final List<String> errorMessages = new ArrayList<>();
    final List<Throwable> exceptions = new ArrayList<>();
    final InventorySyncOptions inventorySyncOptions = InventorySyncOptionsBuilder.of(mock(SphereClient.class)).errorCallback((exception, oldResource, newResource, actions) -> {
        errorMessages.add(exception.getMessage());
        exceptions.add(exception.getCause());
    }).build();
    final TypeService typeService = spy(new TypeServiceImpl(inventorySyncOptions));
    when(typeService.cacheKeysToIds(anySet())).thenReturn(supplyAsync(() -> {
        throw new SphereException();
    }));
    final InventorySync inventorySync = new InventorySync(inventorySyncOptions, mock(InventoryService.class), mock(ChannelService.class), typeService);
    final InventoryEntryDraft newInventoryDraftWithCustomType = mock(InventoryEntryDraft.class);
    when(newInventoryDraftWithCustomType.getSku()).thenReturn("sku");
    when(newInventoryDraftWithCustomType.getCustom()).thenReturn(CustomFieldsDraft.ofTypeKeyAndJson("typeKey", emptyMap()));
    // test
    final InventorySyncStatistics inventorySyncStatistics = inventorySync.sync(singletonList(newInventoryDraftWithCustomType)).toCompletableFuture().join();
    // assertions
    AssertionsForStatistics.assertThat(inventorySyncStatistics).hasValues(1, 0, 0, 1);
    assertThat(errorMessages).hasSize(1).singleElement(as(STRING)).contains("Failed to build a cache of keys to ids.");
    assertThat(exceptions).hasSize(1).singleElement(as(THROWABLE)).isExactlyInstanceOf(CompletionException.class).hasCauseExactlyInstanceOf(SphereException.class);
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Reference(io.sphere.sdk.models.Reference) ReferenceResolutionException(com.commercetools.sync.commons.exceptions.ReferenceResolutionException) InventoryEntryDraft(io.sphere.sdk.inventory.InventoryEntryDraft) CompletableFuture.completedFuture(java.util.concurrent.CompletableFuture.completedFuture) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) ZonedDateTime(java.time.ZonedDateTime) InventorySyncMockUtils.getCompletionStageWithException(com.commercetools.sync.inventories.InventorySyncMockUtils.getCompletionStageWithException) Channel(io.sphere.sdk.channels.Channel) Collections.singletonList(java.util.Collections.singletonList) Arrays.asList(java.util.Arrays.asList) THROWABLE(org.assertj.core.api.InstanceOfAssertFactories.THROWABLE) SphereClient(io.sphere.sdk.client.SphereClient) InventorySyncMockUtils.getMockSupplyChannel(com.commercetools.sync.inventories.InventorySyncMockUtils.getMockSupplyChannel) InventorySyncMockUtils.getMockInventoryService(com.commercetools.sync.inventories.InventorySyncMockUtils.getMockInventoryService) Collections.emptyList(java.util.Collections.emptyList) InventoryEntry(io.sphere.sdk.inventory.InventoryEntry) Set(java.util.Set) CompletionException(java.util.concurrent.CompletionException) String.format(java.lang.String.format) ZoneId(java.time.ZoneId) Test(org.junit.jupiter.api.Test) InventoryEntryDraftBuilder(io.sphere.sdk.inventory.InventoryEntryDraftBuilder) ChannelService(com.commercetools.sync.services.ChannelService) List(java.util.List) SphereInternalUtils.asSet(io.sphere.sdk.utils.SphereInternalUtils.asSet) Optional(java.util.Optional) InventorySyncMockUtils.getMockInventoryEntry(com.commercetools.sync.inventories.InventorySyncMockUtils.getMockInventoryEntry) AssertionsForStatistics(com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics) Mockito.mock(org.mockito.Mockito.mock) ResourceIdentifier(io.sphere.sdk.models.ResourceIdentifier) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) ArgumentMatchers.anySet(org.mockito.ArgumentMatchers.anySet) InventorySyncMockUtils.getMockChannelService(com.commercetools.sync.inventories.InventorySyncMockUtils.getMockChannelService) InventoryService(com.commercetools.sync.services.InventoryService) AssertionsForStatistics.assertThat(com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics.assertThat) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) Mockito.spy(org.mockito.Mockito.spy) ArrayList(java.util.ArrayList) Assertions.as(org.assertj.core.api.Assertions.as) CompletableFuture.supplyAsync(java.util.concurrent.CompletableFuture.supplyAsync) TypeService(com.commercetools.sync.services.TypeService) SphereException(io.sphere.sdk.models.SphereException) Collections.emptyMap(java.util.Collections.emptyMap) Mockito.when(org.mockito.Mockito.when) TypeServiceImpl(com.commercetools.sync.services.impl.TypeServiceImpl) Mockito.verify(org.mockito.Mockito.verify) Mockito.never(org.mockito.Mockito.never) CustomFieldsDraft(io.sphere.sdk.types.CustomFieldsDraft) STRING(org.assertj.core.api.InstanceOfAssertFactories.STRING) Collections(java.util.Collections) InventorySyncStatistics(com.commercetools.sync.inventories.helpers.InventorySyncStatistics) BLANK_KEY_VALUE_ON_RESOURCE_IDENTIFIER(com.commercetools.sync.commons.helpers.BaseReferenceResolver.BLANK_KEY_VALUE_ON_RESOURCE_IDENTIFIER) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) InventorySyncMockUtils.getMockInventoryService(com.commercetools.sync.inventories.InventorySyncMockUtils.getMockInventoryService) InventoryService(com.commercetools.sync.services.InventoryService) ArrayList(java.util.ArrayList) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) TypeServiceImpl(com.commercetools.sync.services.impl.TypeServiceImpl) SphereException(io.sphere.sdk.models.SphereException) InventoryEntryDraft(io.sphere.sdk.inventory.InventoryEntryDraft) ChannelService(com.commercetools.sync.services.ChannelService) InventorySyncMockUtils.getMockChannelService(com.commercetools.sync.inventories.InventorySyncMockUtils.getMockChannelService) SphereClient(io.sphere.sdk.client.SphereClient) CompletionException(java.util.concurrent.CompletionException) InventorySyncStatistics(com.commercetools.sync.inventories.helpers.InventorySyncStatistics) TypeService(com.commercetools.sync.services.TypeService) Test(org.junit.jupiter.api.Test)

Example 4 with AssertionsForStatistics.assertThat

use of com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics.assertThat in project commercetools-sync-java by commercetools.

the class ShoppingListSyncIT method sync_WithUpdatedCustomerOnShoppingList_ShouldReturnProperStatistics.

@Test
void sync_WithUpdatedCustomerOnShoppingList_ShouldReturnProperStatistics() {
    final List<ShoppingList> shoppingLists = CTP_SOURCE_CLIENT.execute(buildShoppingListQuery()).toCompletableFuture().join().getResults();
    createSampleCustomerJaneDoe(CTP_SOURCE_CLIENT);
    final Customer sampleCustomerJaneDoe = createSampleCustomerJaneDoe(CTP_TARGET_CLIENT);
    final List<ShoppingListDraft> updatedShoppingListDrafts = ShoppingListTransformUtils.toShoppingListDrafts(CTP_SOURCE_CLIENT, referenceIdToKeyCache, shoppingLists).join().stream().map(shoppingListDraft -> ShoppingListDraftBuilder.of(shoppingListDraft).name(LocalizedString.ofEnglish("second-shopping-list")).anonymousId(null).customer(ResourceIdentifier.ofKey(sampleCustomerJaneDoe.getKey())).build()).collect(Collectors.toList());
    final ShoppingListSyncStatistics shoppingListSyncStatistics = shoppingListSync.sync(updatedShoppingListDrafts).toCompletableFuture().join();
    assertThat(errorMessages).isEmpty();
    assertThat(warningMessages).isEmpty();
    assertThat(exceptions).isEmpty();
    // order is important, otherwise the error below could occur:
    // "message" : "The resource was already claimed by a customer..
    // "action" : {
    // "action" : "setAnonymousId"
    // }
    assertThat(updateActionList).containsExactly(ChangeName.of(LocalizedString.ofEnglish("second-shopping-list")), SetAnonymousId.of(null), SetCustomer.of(Reference.of(Customer.referenceTypeId(), sampleCustomerJaneDoe.getId())));
    AssertionsForStatistics.assertThat(shoppingListSyncStatistics).hasValues(2, 1, 1, 0);
    assertThat(shoppingListSyncStatistics.getReportMessage()).isEqualTo("Summary: 2 shopping lists were processed in total " + "(1 created, 1 updated and 0 failed to sync).");
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Reference(io.sphere.sdk.models.Reference) CTP_SOURCE_CLIENT(com.commercetools.sync.integration.commons.utils.SphereClientUtils.CTP_SOURCE_CLIENT) SetAnonymousId(io.sphere.sdk.shoppinglists.commands.updateactions.SetAnonymousId) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) ShoppingListSyncOptions(com.commercetools.sync.shoppinglists.ShoppingListSyncOptions) AssertionsForStatistics.assertThat(com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics.assertThat) UpdateAction(io.sphere.sdk.commands.UpdateAction) ShoppingList(io.sphere.sdk.shoppinglists.ShoppingList) ShoppingListSyncOptionsBuilder(com.commercetools.sync.shoppinglists.ShoppingListSyncOptionsBuilder) ShoppingListTransformUtils(com.commercetools.sync.shoppinglists.utils.ShoppingListTransformUtils) ArrayList(java.util.ArrayList) AfterAll(org.junit.jupiter.api.AfterAll) ShoppingListITUtils.createShoppingList(com.commercetools.sync.integration.commons.utils.ShoppingListITUtils.createShoppingList) ReferenceIdToKeyCache(com.commercetools.sync.commons.utils.ReferenceIdToKeyCache) ShoppingListDraftBuilder(io.sphere.sdk.shoppinglists.ShoppingListDraftBuilder) CustomerITUtils.createSampleCustomerJaneDoe(com.commercetools.sync.integration.commons.utils.CustomerITUtils.createSampleCustomerJaneDoe) CaffeineReferenceIdToKeyCacheImpl(com.commercetools.sync.commons.utils.CaffeineReferenceIdToKeyCacheImpl) ShoppingListSync(com.commercetools.sync.shoppinglists.ShoppingListSync) ShoppingListSyncStatistics(com.commercetools.sync.shoppinglists.helpers.ShoppingListSyncStatistics) ShoppingListITUtils.deleteShoppingListTestData(com.commercetools.sync.integration.commons.utils.ShoppingListITUtils.deleteShoppingListTestData) ChangeName(io.sphere.sdk.shoppinglists.commands.updateactions.ChangeName) ShoppingListITUtils.createSampleShoppingListCarrotCake(com.commercetools.sync.integration.commons.utils.ShoppingListITUtils.createSampleShoppingListCarrotCake) Customer(io.sphere.sdk.customers.Customer) Collectors(java.util.stream.Collectors) ShoppingListReferenceResolutionUtils.buildShoppingListQuery(com.commercetools.sync.shoppinglists.utils.ShoppingListReferenceResolutionUtils.buildShoppingListQuery) Objects(java.util.Objects) Test(org.junit.jupiter.api.Test) LocalizedString(io.sphere.sdk.models.LocalizedString) ShoppingListDraft(io.sphere.sdk.shoppinglists.ShoppingListDraft) List(java.util.List) SetCustomer(io.sphere.sdk.shoppinglists.commands.updateactions.SetCustomer) AssertionsForStatistics(com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics) CTP_TARGET_CLIENT(com.commercetools.sync.integration.commons.utils.SphereClientUtils.CTP_TARGET_CLIENT) ResourceIdentifier(io.sphere.sdk.models.ResourceIdentifier) ShoppingListSyncStatistics(com.commercetools.sync.shoppinglists.helpers.ShoppingListSyncStatistics) Customer(io.sphere.sdk.customers.Customer) SetCustomer(io.sphere.sdk.shoppinglists.commands.updateactions.SetCustomer) ShoppingList(io.sphere.sdk.shoppinglists.ShoppingList) ShoppingListITUtils.createShoppingList(com.commercetools.sync.integration.commons.utils.ShoppingListITUtils.createShoppingList) ShoppingListDraft(io.sphere.sdk.shoppinglists.ShoppingListDraft) Test(org.junit.jupiter.api.Test)

Aggregations

AssertionsForStatistics (com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics)4 AssertionsForStatistics.assertThat (com.commercetools.sync.commons.asserts.statistics.AssertionsForStatistics.assertThat)4 ArrayList (java.util.ArrayList)4 List (java.util.List)4 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)4 Test (org.junit.jupiter.api.Test)4 SphereClient (io.sphere.sdk.client.SphereClient)3 ResourceIdentifier (io.sphere.sdk.models.ResourceIdentifier)3 SphereException (io.sphere.sdk.models.SphereException)3 Collections.emptyMap (java.util.Collections.emptyMap)3 Collections.singletonList (java.util.Collections.singletonList)3 Optional (java.util.Optional)3 CompletableFuture.completedFuture (java.util.concurrent.CompletableFuture.completedFuture)3 CompletableFuture.supplyAsync (java.util.concurrent.CompletableFuture.supplyAsync)3 CompletionException (java.util.concurrent.CompletionException)3 Assertions.as (org.assertj.core.api.Assertions.as)3 STRING (org.assertj.core.api.InstanceOfAssertFactories.STRING)3 ArgumentMatchers.any (org.mockito.ArgumentMatchers.any)3 ArgumentMatchers.anySet (org.mockito.ArgumentMatchers.anySet)3 Mockito.mock (org.mockito.Mockito.mock)3