use of com.commercetools.sync.shoppinglists.helpers.ShoppingListSyncStatistics in project commercetools-sync-java by commercetools.
the class ShoppingListSyncTest method sync_WithoutName_ShouldExecuteCallbackOnErrorAndIncreaseFailedCounter.
@Test
void sync_WithoutName_ShouldExecuteCallbackOnErrorAndIncreaseFailedCounter() {
// preparation
ShoppingListDraft shoppingListDraft = ShoppingListDraftBuilder.of(LocalizedString.of()).key("shopping-list-key").build();
ShoppingListSync shoppingListSync = new ShoppingListSync(syncOptions);
// test
ShoppingListSyncStatistics statistics = shoppingListSync.sync(singletonList(shoppingListDraft)).toCompletableFuture().join();
AssertionsForStatistics.assertThat(statistics).hasValues(1, 0, 0, 1);
// assertions
assertThat(errorMessages).hasSize(1).singleElement(as(STRING)).isEqualTo(format(SHOPPING_LIST_DRAFT_NAME_NOT_SET, shoppingListDraft.getKey()));
}
Aggregations