use of com.commercetools.sync.customers.CustomerSyncOptions in project commercetools-sync-java by commercetools.
the class CustomerSyncIT method setUpCustomerSync.
private void setUpCustomerSync() {
errorMessages = new ArrayList<>();
exceptions = new ArrayList<>();
warningMessages = new ArrayList<>();
updateActionList = new ArrayList<>();
CustomerSyncOptions customerSyncOptions = CustomerSyncOptionsBuilder.of(CTP_TARGET_CLIENT).errorCallback((exception, oldResource, newResource, actions) -> {
errorMessages.add(exception.getMessage());
exceptions.add(exception);
}).warningCallback((exception, oldResource, newResource) -> warningMessages.add(exception.getMessage())).beforeUpdateCallback((updateActions, customerDraft, customer) -> {
updateActionList.addAll(Objects.requireNonNull(updateActions));
return updateActions;
}).build();
customerSync = new CustomerSync(customerSyncOptions);
}
Aggregations