Search in sources :

Example 11 with TypeSyncOptions

use of com.commercetools.sync.types.TypeSyncOptions in project commercetools-sync-java by commercetools.

the class TypeServiceImplIT method setup.

/**
 * Deletes types from the target CTP project, then it populates the project with test data.
 */
@BeforeEach
void setup() {
    errorCallBackMessages = new ArrayList<>();
    errorCallBackExceptions = new ArrayList<>();
    deleteAllCategories(CTP_TARGET_CLIENT);
    deleteTypes(CTP_TARGET_CLIENT);
    createCategoriesCustomType(OLD_TYPE_KEY, OLD_TYPE_LOCALE, OLD_TYPE_NAME, CTP_TARGET_CLIENT);
    final TypeSyncOptions typeSyncOptions = TypeSyncOptionsBuilder.of(CTP_TARGET_CLIENT).errorCallback((exception, oldResource, newResource, updateActions) -> {
        errorCallBackMessages.add(exception.getMessage());
        errorCallBackExceptions.add(exception.getCause());
    }).build();
    typeService = new TypeServiceImpl(typeSyncOptions);
}
Also used : TypeDraft(io.sphere.sdk.types.TypeDraft) BeforeEach(org.junit.jupiter.api.BeforeEach) TYPE_DESCRIPTION_1(com.commercetools.sync.integration.commons.utils.TypeITUtils.TYPE_DESCRIPTION_1) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) StringUtils(org.apache.commons.lang3.StringUtils) Collections.singletonList(java.util.Collections.singletonList) AfterAll(org.junit.jupiter.api.AfterAll) Collections.singleton(java.util.Collections.singleton) Locale(java.util.Locale) SphereClient(io.sphere.sdk.client.SphereClient) ChangeKey(io.sphere.sdk.types.commands.updateactions.ChangeKey) BadGatewayException(io.sphere.sdk.client.BadGatewayException) CompletionStageUtil.executeBlocking(com.commercetools.tests.utils.CompletionStageUtil.executeBlocking) Set(java.util.Set) FIELD_DEFINITION_1(com.commercetools.sync.integration.commons.utils.TypeITUtils.FIELD_DEFINITION_1) Test(org.junit.jupiter.api.Test) TYPE_KEY_1(com.commercetools.sync.integration.commons.utils.TypeITUtils.TYPE_KEY_1) List(java.util.List) LocalizedString.ofEnglish(io.sphere.sdk.models.LocalizedString.ofEnglish) Optional(java.util.Optional) CTP_TARGET_CLIENT(com.commercetools.sync.integration.commons.utils.SphereClientUtils.CTP_TARGET_CLIENT) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) TypeSyncOptionsBuilder(com.commercetools.sync.types.TypeSyncOptionsBuilder) ResourceTypeIdsSetBuilder(io.sphere.sdk.types.ResourceTypeIdsSetBuilder) Mockito.spy(org.mockito.Mockito.spy) CompletableFutureUtils(io.sphere.sdk.utils.CompletableFutureUtils) DuplicateFieldError(io.sphere.sdk.models.errors.DuplicateFieldError) TypeSyncOptions(com.commercetools.sync.types.TypeSyncOptions) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Assertions.as(org.assertj.core.api.Assertions.as) TypeService(com.commercetools.sync.services.TypeService) TypeQuery(io.sphere.sdk.types.queries.TypeQuery) TypeDraftBuilder(io.sphere.sdk.types.TypeDraftBuilder) TYPE_NAME_1(com.commercetools.sync.integration.commons.utils.TypeITUtils.TYPE_NAME_1) CategoryITUtils.deleteAllCategories(com.commercetools.sync.integration.commons.utils.CategoryITUtils.deleteAllCategories) CategoryITUtils.createCategoriesCustomType(com.commercetools.sync.integration.commons.utils.CategoryITUtils.createCategoriesCustomType) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) TypeServiceImpl(com.commercetools.sync.services.impl.TypeServiceImpl) ChangeName(io.sphere.sdk.types.commands.updateactions.ChangeName) Mockito.verify(org.mockito.Mockito.verify) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Collectors.toList(java.util.stream.Collectors.toList) ErrorResponseException(io.sphere.sdk.client.ErrorResponseException) TypeITUtils.deleteTypes(com.commercetools.sync.integration.commons.utils.TypeITUtils.deleteTypes) STRING(org.assertj.core.api.InstanceOfAssertFactories.STRING) Collections(java.util.Collections) Type(io.sphere.sdk.types.Type) TypeSyncOptions(com.commercetools.sync.types.TypeSyncOptions) TypeServiceImpl(com.commercetools.sync.services.impl.TypeServiceImpl) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 12 with TypeSyncOptions

use of com.commercetools.sync.types.TypeSyncOptions in project commercetools-sync-java by commercetools.

the class TypeServiceImplIT method createType_WithInvalidType_ShouldHaveEmptyOptionalAsAResult.

@Test
void createType_WithInvalidType_ShouldHaveEmptyOptionalAsAResult() {
    // preparation
    final TypeDraft newTypeDraft = TypeDraftBuilder.of("", TYPE_NAME_1, ResourceTypeIdsSetBuilder.of().addCategories().build()).description(TYPE_DESCRIPTION_1).fieldDefinitions(singletonList(FIELD_DEFINITION_1)).build();
    final TypeSyncOptions options = TypeSyncOptionsBuilder.of(CTP_TARGET_CLIENT).errorCallback((exception, oldResource, newResource, updateActions) -> {
        errorCallBackMessages.add(exception.getMessage());
        errorCallBackExceptions.add(exception.getCause());
    }).build();
    final TypeService typeService = new TypeServiceImpl(options);
    // test
    final Optional<Type> result = typeService.createType(newTypeDraft).toCompletableFuture().join();
    // assertion
    assertThat(result).isEmpty();
    assertThat(errorCallBackMessages).containsExactly("Failed to create draft with key: ''. Reason: Draft key is blank!");
}
Also used : TypeDraft(io.sphere.sdk.types.TypeDraft) BeforeEach(org.junit.jupiter.api.BeforeEach) TYPE_DESCRIPTION_1(com.commercetools.sync.integration.commons.utils.TypeITUtils.TYPE_DESCRIPTION_1) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) StringUtils(org.apache.commons.lang3.StringUtils) Collections.singletonList(java.util.Collections.singletonList) AfterAll(org.junit.jupiter.api.AfterAll) Collections.singleton(java.util.Collections.singleton) Locale(java.util.Locale) SphereClient(io.sphere.sdk.client.SphereClient) ChangeKey(io.sphere.sdk.types.commands.updateactions.ChangeKey) BadGatewayException(io.sphere.sdk.client.BadGatewayException) CompletionStageUtil.executeBlocking(com.commercetools.tests.utils.CompletionStageUtil.executeBlocking) Set(java.util.Set) FIELD_DEFINITION_1(com.commercetools.sync.integration.commons.utils.TypeITUtils.FIELD_DEFINITION_1) Test(org.junit.jupiter.api.Test) TYPE_KEY_1(com.commercetools.sync.integration.commons.utils.TypeITUtils.TYPE_KEY_1) List(java.util.List) LocalizedString.ofEnglish(io.sphere.sdk.models.LocalizedString.ofEnglish) Optional(java.util.Optional) CTP_TARGET_CLIENT(com.commercetools.sync.integration.commons.utils.SphereClientUtils.CTP_TARGET_CLIENT) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) TypeSyncOptionsBuilder(com.commercetools.sync.types.TypeSyncOptionsBuilder) ResourceTypeIdsSetBuilder(io.sphere.sdk.types.ResourceTypeIdsSetBuilder) Mockito.spy(org.mockito.Mockito.spy) CompletableFutureUtils(io.sphere.sdk.utils.CompletableFutureUtils) DuplicateFieldError(io.sphere.sdk.models.errors.DuplicateFieldError) TypeSyncOptions(com.commercetools.sync.types.TypeSyncOptions) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Assertions.as(org.assertj.core.api.Assertions.as) TypeService(com.commercetools.sync.services.TypeService) TypeQuery(io.sphere.sdk.types.queries.TypeQuery) TypeDraftBuilder(io.sphere.sdk.types.TypeDraftBuilder) TYPE_NAME_1(com.commercetools.sync.integration.commons.utils.TypeITUtils.TYPE_NAME_1) CategoryITUtils.deleteAllCategories(com.commercetools.sync.integration.commons.utils.CategoryITUtils.deleteAllCategories) CategoryITUtils.createCategoriesCustomType(com.commercetools.sync.integration.commons.utils.CategoryITUtils.createCategoriesCustomType) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) TypeServiceImpl(com.commercetools.sync.services.impl.TypeServiceImpl) ChangeName(io.sphere.sdk.types.commands.updateactions.ChangeName) Mockito.verify(org.mockito.Mockito.verify) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Collectors.toList(java.util.stream.Collectors.toList) ErrorResponseException(io.sphere.sdk.client.ErrorResponseException) TypeITUtils.deleteTypes(com.commercetools.sync.integration.commons.utils.TypeITUtils.deleteTypes) STRING(org.assertj.core.api.InstanceOfAssertFactories.STRING) Collections(java.util.Collections) Type(io.sphere.sdk.types.Type) CategoryITUtils.createCategoriesCustomType(com.commercetools.sync.integration.commons.utils.CategoryITUtils.createCategoriesCustomType) Type(io.sphere.sdk.types.Type) TypeSyncOptions(com.commercetools.sync.types.TypeSyncOptions) TypeServiceImpl(com.commercetools.sync.services.impl.TypeServiceImpl) TypeDraft(io.sphere.sdk.types.TypeDraft) TypeService(com.commercetools.sync.services.TypeService) Test(org.junit.jupiter.api.Test)

Example 13 with TypeSyncOptions

use of com.commercetools.sync.types.TypeSyncOptions in project commercetools-sync-java by commercetools.

the class TypeServiceImplIT method createType_WithDuplicateKey_ShouldHaveEmptyOptionalAsAResult.

@Test
void createType_WithDuplicateKey_ShouldHaveEmptyOptionalAsAResult() {
    // preparation
    final TypeDraft newTypeDraft = TypeDraftBuilder.of(OLD_TYPE_KEY, TYPE_NAME_1, ResourceTypeIdsSetBuilder.of().addCategories().build()).description(TYPE_DESCRIPTION_1).fieldDefinitions(singletonList(FIELD_DEFINITION_1)).build();
    final TypeSyncOptions options = TypeSyncOptionsBuilder.of(CTP_TARGET_CLIENT).errorCallback((exception, oldResource, newResource, updateActions) -> {
        errorCallBackMessages.add(exception.getMessage());
        errorCallBackExceptions.add(exception.getCause());
    }).build();
    final TypeService typeService = new TypeServiceImpl(options);
    // test
    final Optional<Type> result = typeService.createType(newTypeDraft).toCompletableFuture().join();
    // assertion
    assertThat(result).isEmpty();
    assertThat(errorCallBackMessages).hasSize(1).singleElement(as(STRING)).contains("A duplicate value");
    assertThat(errorCallBackExceptions).hasSize(1).singleElement().matches(exception -> {
        assertThat(exception).isExactlyInstanceOf(ErrorResponseException.class);
        final ErrorResponseException errorResponseException = (ErrorResponseException) exception;
        final List<DuplicateFieldError> fieldErrors = errorResponseException.getErrors().stream().map(sphereError -> {
            assertThat(sphereError.getCode()).isEqualTo(DuplicateFieldError.CODE);
            return sphereError.as(DuplicateFieldError.class);
        }).collect(toList());
        return fieldErrors.size() == 1;
    });
}
Also used : TypeDraft(io.sphere.sdk.types.TypeDraft) BeforeEach(org.junit.jupiter.api.BeforeEach) TYPE_DESCRIPTION_1(com.commercetools.sync.integration.commons.utils.TypeITUtils.TYPE_DESCRIPTION_1) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) StringUtils(org.apache.commons.lang3.StringUtils) Collections.singletonList(java.util.Collections.singletonList) AfterAll(org.junit.jupiter.api.AfterAll) Collections.singleton(java.util.Collections.singleton) Locale(java.util.Locale) SphereClient(io.sphere.sdk.client.SphereClient) ChangeKey(io.sphere.sdk.types.commands.updateactions.ChangeKey) BadGatewayException(io.sphere.sdk.client.BadGatewayException) CompletionStageUtil.executeBlocking(com.commercetools.tests.utils.CompletionStageUtil.executeBlocking) Set(java.util.Set) FIELD_DEFINITION_1(com.commercetools.sync.integration.commons.utils.TypeITUtils.FIELD_DEFINITION_1) Test(org.junit.jupiter.api.Test) TYPE_KEY_1(com.commercetools.sync.integration.commons.utils.TypeITUtils.TYPE_KEY_1) List(java.util.List) LocalizedString.ofEnglish(io.sphere.sdk.models.LocalizedString.ofEnglish) Optional(java.util.Optional) CTP_TARGET_CLIENT(com.commercetools.sync.integration.commons.utils.SphereClientUtils.CTP_TARGET_CLIENT) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) TypeSyncOptionsBuilder(com.commercetools.sync.types.TypeSyncOptionsBuilder) ResourceTypeIdsSetBuilder(io.sphere.sdk.types.ResourceTypeIdsSetBuilder) Mockito.spy(org.mockito.Mockito.spy) CompletableFutureUtils(io.sphere.sdk.utils.CompletableFutureUtils) DuplicateFieldError(io.sphere.sdk.models.errors.DuplicateFieldError) TypeSyncOptions(com.commercetools.sync.types.TypeSyncOptions) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Assertions.as(org.assertj.core.api.Assertions.as) TypeService(com.commercetools.sync.services.TypeService) TypeQuery(io.sphere.sdk.types.queries.TypeQuery) TypeDraftBuilder(io.sphere.sdk.types.TypeDraftBuilder) TYPE_NAME_1(com.commercetools.sync.integration.commons.utils.TypeITUtils.TYPE_NAME_1) CategoryITUtils.deleteAllCategories(com.commercetools.sync.integration.commons.utils.CategoryITUtils.deleteAllCategories) CategoryITUtils.createCategoriesCustomType(com.commercetools.sync.integration.commons.utils.CategoryITUtils.createCategoriesCustomType) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) TypeServiceImpl(com.commercetools.sync.services.impl.TypeServiceImpl) ChangeName(io.sphere.sdk.types.commands.updateactions.ChangeName) Mockito.verify(org.mockito.Mockito.verify) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Collectors.toList(java.util.stream.Collectors.toList) ErrorResponseException(io.sphere.sdk.client.ErrorResponseException) TypeITUtils.deleteTypes(com.commercetools.sync.integration.commons.utils.TypeITUtils.deleteTypes) STRING(org.assertj.core.api.InstanceOfAssertFactories.STRING) Collections(java.util.Collections) Type(io.sphere.sdk.types.Type) CategoryITUtils.createCategoriesCustomType(com.commercetools.sync.integration.commons.utils.CategoryITUtils.createCategoriesCustomType) Type(io.sphere.sdk.types.Type) DuplicateFieldError(io.sphere.sdk.models.errors.DuplicateFieldError) TypeSyncOptions(com.commercetools.sync.types.TypeSyncOptions) ErrorResponseException(io.sphere.sdk.client.ErrorResponseException) TypeServiceImpl(com.commercetools.sync.services.impl.TypeServiceImpl) TypeDraft(io.sphere.sdk.types.TypeDraft) TypeService(com.commercetools.sync.services.TypeService) Test(org.junit.jupiter.api.Test)

Example 14 with TypeSyncOptions

use of com.commercetools.sync.types.TypeSyncOptions in project commercetools-sync-java by commercetools.

the class TypeServiceImplIT method fetchMatchingTypesByKeys_WithBadGateWayExceptionAlways_ShouldFail.

@Test
void fetchMatchingTypesByKeys_WithBadGateWayExceptionAlways_ShouldFail() {
    // Mock sphere client to return BadGatewayException on any request.
    final SphereClient spyClient = spy(CTP_TARGET_CLIENT);
    when(spyClient.execute(any(TypeQuery.class))).thenReturn(CompletableFutureUtils.exceptionallyCompletedFuture(new BadGatewayException())).thenCallRealMethod();
    final TypeSyncOptions spyOptions = TypeSyncOptionsBuilder.of(spyClient).errorCallback((exception, oldResource, newResource, updateActions) -> {
        errorCallBackMessages.add(exception.getMessage());
        errorCallBackExceptions.add(exception.getCause());
    }).build();
    final TypeService spyTypeService = new TypeServiceImpl(spyOptions);
    final Set<String> keys = new HashSet<>();
    keys.add(OLD_TYPE_KEY);
    // test and assert
    assertThat(errorCallBackExceptions).isEmpty();
    assertThat(errorCallBackMessages).isEmpty();
    assertThat(spyTypeService.fetchMatchingTypesByKeys(keys)).failsWithin(10, TimeUnit.SECONDS).withThrowableOfType(ExecutionException.class).withCauseExactlyInstanceOf(BadGatewayException.class);
}
Also used : TypeDraft(io.sphere.sdk.types.TypeDraft) BeforeEach(org.junit.jupiter.api.BeforeEach) TYPE_DESCRIPTION_1(com.commercetools.sync.integration.commons.utils.TypeITUtils.TYPE_DESCRIPTION_1) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) StringUtils(org.apache.commons.lang3.StringUtils) Collections.singletonList(java.util.Collections.singletonList) AfterAll(org.junit.jupiter.api.AfterAll) Collections.singleton(java.util.Collections.singleton) Locale(java.util.Locale) SphereClient(io.sphere.sdk.client.SphereClient) ChangeKey(io.sphere.sdk.types.commands.updateactions.ChangeKey) BadGatewayException(io.sphere.sdk.client.BadGatewayException) CompletionStageUtil.executeBlocking(com.commercetools.tests.utils.CompletionStageUtil.executeBlocking) Set(java.util.Set) FIELD_DEFINITION_1(com.commercetools.sync.integration.commons.utils.TypeITUtils.FIELD_DEFINITION_1) Test(org.junit.jupiter.api.Test) TYPE_KEY_1(com.commercetools.sync.integration.commons.utils.TypeITUtils.TYPE_KEY_1) List(java.util.List) LocalizedString.ofEnglish(io.sphere.sdk.models.LocalizedString.ofEnglish) Optional(java.util.Optional) CTP_TARGET_CLIENT(com.commercetools.sync.integration.commons.utils.SphereClientUtils.CTP_TARGET_CLIENT) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) TypeSyncOptionsBuilder(com.commercetools.sync.types.TypeSyncOptionsBuilder) ResourceTypeIdsSetBuilder(io.sphere.sdk.types.ResourceTypeIdsSetBuilder) Mockito.spy(org.mockito.Mockito.spy) CompletableFutureUtils(io.sphere.sdk.utils.CompletableFutureUtils) DuplicateFieldError(io.sphere.sdk.models.errors.DuplicateFieldError) TypeSyncOptions(com.commercetools.sync.types.TypeSyncOptions) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Assertions.as(org.assertj.core.api.Assertions.as) TypeService(com.commercetools.sync.services.TypeService) TypeQuery(io.sphere.sdk.types.queries.TypeQuery) TypeDraftBuilder(io.sphere.sdk.types.TypeDraftBuilder) TYPE_NAME_1(com.commercetools.sync.integration.commons.utils.TypeITUtils.TYPE_NAME_1) CategoryITUtils.deleteAllCategories(com.commercetools.sync.integration.commons.utils.CategoryITUtils.deleteAllCategories) CategoryITUtils.createCategoriesCustomType(com.commercetools.sync.integration.commons.utils.CategoryITUtils.createCategoriesCustomType) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) TypeServiceImpl(com.commercetools.sync.services.impl.TypeServiceImpl) ChangeName(io.sphere.sdk.types.commands.updateactions.ChangeName) Mockito.verify(org.mockito.Mockito.verify) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Collectors.toList(java.util.stream.Collectors.toList) ErrorResponseException(io.sphere.sdk.client.ErrorResponseException) TypeITUtils.deleteTypes(com.commercetools.sync.integration.commons.utils.TypeITUtils.deleteTypes) STRING(org.assertj.core.api.InstanceOfAssertFactories.STRING) Collections(java.util.Collections) Type(io.sphere.sdk.types.Type) SphereClient(io.sphere.sdk.client.SphereClient) TypeSyncOptions(com.commercetools.sync.types.TypeSyncOptions) BadGatewayException(io.sphere.sdk.client.BadGatewayException) TypeServiceImpl(com.commercetools.sync.services.impl.TypeServiceImpl) ExecutionException(java.util.concurrent.ExecutionException) TypeService(com.commercetools.sync.services.TypeService) HashSet(java.util.HashSet) Test(org.junit.jupiter.api.Test)

Example 15 with TypeSyncOptions

use of com.commercetools.sync.types.TypeSyncOptions in project commercetools-sync-java by commercetools.

the class BuildFieldDefinitionUpdateActionsTest method buildFieldDefinitionsUpdateActions_WithDuplicateFieldDefNames_ShouldNotBuildActionsAndTriggerErrorCb.

@Test
void buildFieldDefinitionsUpdateActions_WithDuplicateFieldDefNames_ShouldNotBuildActionsAndTriggerErrorCb() {
    final Type oldType = readObjectFromResource(TYPE_WITH_FIELDS_ABC, Type.class);
    final TypeDraft newTypeDraft = readObjectFromResource(TYPE_WITH_FIELDS_ABB, TypeDraft.class);
    final List<String> errorMessages = new ArrayList<>();
    final List<Throwable> exceptions = new ArrayList<>();
    final TypeSyncOptions syncOptions = TypeSyncOptionsBuilder.of(mock(SphereClient.class)).errorCallback((exception, oldResource, newResource, updateActions) -> {
        errorMessages.add(exception.getMessage());
        exceptions.add(exception.getCause());
    }).build();
    final List<UpdateAction<Type>> updateActions = buildFieldDefinitionsUpdateActions(oldType, newTypeDraft, syncOptions);
    assertThat(updateActions).isEmpty();
    assertThat(errorMessages).hasSize(1);
    assertThat(errorMessages.get(0)).matches("Failed to build update actions for the field definitions of the " + "type with the key 'key'. Reason: .*DuplicateNameException: Field definitions " + "have duplicated names. Duplicated field definition name: 'b'. Field definitions names are " + "expected to be unique inside their type.");
    assertThat(exceptions).hasSize(1);
    assertThat(exceptions.get(0)).isExactlyInstanceOf(BuildUpdateActionException.class);
    assertThat(exceptions.get(0).getMessage()).contains("Field definitions have duplicated names. " + "Duplicated field definition name: 'b'. Field definitions names are expected to be unique " + "inside their type.");
    assertThat(exceptions.get(0).getCause()).isExactlyInstanceOf(DuplicateNameException.class);
}
Also used : TypeDraft(io.sphere.sdk.types.TypeDraft) TypeSyncOptionsBuilder(com.commercetools.sync.types.TypeSyncOptionsBuilder) SphereJsonUtils.readObjectFromResource(io.sphere.sdk.json.SphereJsonUtils.readObjectFromResource) ResourceTypeIdsSetBuilder(io.sphere.sdk.types.ResourceTypeIdsSetBuilder) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) UpdateAction(io.sphere.sdk.commands.UpdateAction) ChangeFieldDefinitionLabel(io.sphere.sdk.types.commands.updateactions.ChangeFieldDefinitionLabel) Collections.singletonList(java.util.Collections.singletonList) TypeSyncOptions(com.commercetools.sync.types.TypeSyncOptions) FieldDefinition(io.sphere.sdk.types.FieldDefinition) ArrayList(java.util.ArrayList) LocalizedEnumFieldType(io.sphere.sdk.types.LocalizedEnumFieldType) ChangeLocalizedEnumValueOrder(io.sphere.sdk.types.commands.updateactions.ChangeLocalizedEnumValueOrder) Arrays.asList(java.util.Arrays.asList) SphereClient(io.sphere.sdk.client.SphereClient) EnumValue(io.sphere.sdk.models.EnumValue) TypeUpdateActionUtils.buildFieldDefinitionsUpdateActions(com.commercetools.sync.types.utils.TypeUpdateActionUtils.buildFieldDefinitionsUpdateActions) TypeDraftBuilder(io.sphere.sdk.types.TypeDraftBuilder) AddLocalizedEnumValue(io.sphere.sdk.types.commands.updateactions.AddLocalizedEnumValue) ChangeEnumValueOrder(io.sphere.sdk.types.commands.updateactions.ChangeEnumValueOrder) RemoveFieldDefinition(io.sphere.sdk.types.commands.updateactions.RemoveFieldDefinition) StringFieldType(io.sphere.sdk.types.StringFieldType) AddEnumValue(io.sphere.sdk.types.commands.updateactions.AddEnumValue) FieldDefinitionFixtures(com.commercetools.sync.types.utils.FieldDefinitionFixtures) Collections.emptySet(java.util.Collections.emptySet) ChangeFieldDefinitionOrder(io.sphere.sdk.types.commands.updateactions.ChangeFieldDefinitionOrder) Collections.emptyList(java.util.Collections.emptyList) LocalizedEnumValue(io.sphere.sdk.models.LocalizedEnumValue) AddFieldDefinition(io.sphere.sdk.types.commands.updateactions.AddFieldDefinition) Mockito.when(org.mockito.Mockito.when) DuplicateNameException(com.commercetools.sync.commons.exceptions.DuplicateNameException) Test(org.junit.jupiter.api.Test) LocalizedString(io.sphere.sdk.models.LocalizedString) List(java.util.List) LocalizedString.ofEnglish(io.sphere.sdk.models.LocalizedString.ofEnglish) TextInputHint(io.sphere.sdk.models.TextInputHint) EnumFieldType(io.sphere.sdk.types.EnumFieldType) BuildUpdateActionException(com.commercetools.sync.commons.exceptions.BuildUpdateActionException) SetFieldType(io.sphere.sdk.types.SetFieldType) Mockito.mock(org.mockito.Mockito.mock) Type(io.sphere.sdk.types.Type) LocalizedEnumFieldType(io.sphere.sdk.types.LocalizedEnumFieldType) StringFieldType(io.sphere.sdk.types.StringFieldType) EnumFieldType(io.sphere.sdk.types.EnumFieldType) SetFieldType(io.sphere.sdk.types.SetFieldType) Type(io.sphere.sdk.types.Type) UpdateAction(io.sphere.sdk.commands.UpdateAction) SphereClient(io.sphere.sdk.client.SphereClient) ArrayList(java.util.ArrayList) TypeSyncOptions(com.commercetools.sync.types.TypeSyncOptions) LocalizedString(io.sphere.sdk.models.LocalizedString) TypeDraft(io.sphere.sdk.types.TypeDraft) Test(org.junit.jupiter.api.Test)

Aggregations

TypeSyncOptions (com.commercetools.sync.types.TypeSyncOptions)24 Type (io.sphere.sdk.types.Type)24 TypeDraft (io.sphere.sdk.types.TypeDraft)24 Test (org.junit.jupiter.api.Test)23 TypeSync (com.commercetools.sync.types.TypeSync)18 TypeSyncStatistics (com.commercetools.sync.types.helpers.TypeSyncStatistics)18 TypeSyncOptionsBuilder (com.commercetools.sync.types.TypeSyncOptionsBuilder)17 TypeDraftBuilder (io.sphere.sdk.types.TypeDraftBuilder)17 List (java.util.List)17 EnumFieldType (io.sphere.sdk.types.EnumFieldType)16 LocalizedEnumFieldType (io.sphere.sdk.types.LocalizedEnumFieldType)16 SetFieldType (io.sphere.sdk.types.SetFieldType)16 StringFieldType (io.sphere.sdk.types.StringFieldType)16 TypeQuery (io.sphere.sdk.types.queries.TypeQuery)16 ArrayList (java.util.ArrayList)16 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)16 CTP_TARGET_CLIENT (com.commercetools.sync.integration.commons.utils.SphereClientUtils.CTP_TARGET_CLIENT)15 SphereClient (io.sphere.sdk.client.SphereClient)15 AfterAll (org.junit.jupiter.api.AfterAll)15 BeforeEach (org.junit.jupiter.api.BeforeEach)15