Search in sources :

Example 1 with CustomerGroupServiceImpl

use of com.commercetools.sync.services.impl.CustomerGroupServiceImpl in project commercetools-sync-java by commercetools.

the class CustomerGroupServiceImplIT method setup.

/**
 * Deletes customer group from the target CTP projects, then it populates the project with test
 * data.
 */
@BeforeEach
void setup() {
    deleteCustomerGroups(CTP_TARGET_CLIENT);
    warnings = new ArrayList<>();
    oldCustomerGroup = createCustomerGroup(CTP_TARGET_CLIENT, CUSTOMER_GROUP_NAME, CUSTOMER_GROUP_KEY);
    final ProductSyncOptions productSyncOptions = ProductSyncOptionsBuilder.of(CTP_TARGET_CLIENT).warningCallback((exception, oldResource, newResource) -> warnings.add(exception.getMessage())).build();
    customerGroupService = new CustomerGroupServiceImpl(productSyncOptions);
}
Also used : CustomerGroupITUtils.deleteCustomerGroups(com.commercetools.sync.integration.commons.utils.CustomerGroupITUtils.deleteCustomerGroups) BeforeEach(org.junit.jupiter.api.BeforeEach) CustomerGroup(io.sphere.sdk.customergroups.CustomerGroup) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) CustomerGroupITUtils.createCustomerGroup(com.commercetools.sync.integration.commons.utils.CustomerGroupITUtils.createCustomerGroup) ArrayList(java.util.ArrayList) AfterAll(org.junit.jupiter.api.AfterAll) Test(org.junit.jupiter.api.Test) CustomerGroupServiceImpl(com.commercetools.sync.services.impl.CustomerGroupServiceImpl) ProductSyncOptionsBuilder(com.commercetools.sync.products.ProductSyncOptionsBuilder) CustomerGroupService(com.commercetools.sync.services.CustomerGroupService) Optional(java.util.Optional) CTP_TARGET_CLIENT(com.commercetools.sync.integration.commons.utils.SphereClientUtils.CTP_TARGET_CLIENT) ProductSyncOptions(com.commercetools.sync.products.ProductSyncOptions) CustomerGroupServiceImpl(com.commercetools.sync.services.impl.CustomerGroupServiceImpl) ProductSyncOptions(com.commercetools.sync.products.ProductSyncOptions) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

CustomerGroupITUtils.createCustomerGroup (com.commercetools.sync.integration.commons.utils.CustomerGroupITUtils.createCustomerGroup)1 CustomerGroupITUtils.deleteCustomerGroups (com.commercetools.sync.integration.commons.utils.CustomerGroupITUtils.deleteCustomerGroups)1 CTP_TARGET_CLIENT (com.commercetools.sync.integration.commons.utils.SphereClientUtils.CTP_TARGET_CLIENT)1 ProductSyncOptions (com.commercetools.sync.products.ProductSyncOptions)1 ProductSyncOptionsBuilder (com.commercetools.sync.products.ProductSyncOptionsBuilder)1 CustomerGroupService (com.commercetools.sync.services.CustomerGroupService)1 CustomerGroupServiceImpl (com.commercetools.sync.services.impl.CustomerGroupServiceImpl)1 CustomerGroup (io.sphere.sdk.customergroups.CustomerGroup)1 ArrayList (java.util.ArrayList)1 Optional (java.util.Optional)1 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)1 AfterAll (org.junit.jupiter.api.AfterAll)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 Test (org.junit.jupiter.api.Test)1