use of org.mapstruct.ap.test.value.ExternalOrderType in project mapstruct by mapstruct.
the class EnumToEnumMappingTest method shouldGenerateEnumMappingMethod.
@ProcessorTest
public void shouldGenerateEnumMappingMethod() {
ExternalOrderType target = OrderMapper.INSTANCE.orderTypeToExternalOrderType(OrderType.B2B);
assertThat(target).isEqualTo(ExternalOrderType.B2B);
target = OrderMapper.INSTANCE.orderTypeToExternalOrderType(OrderType.RETAIL);
assertThat(target).isEqualTo(ExternalOrderType.RETAIL);
}
use of org.mapstruct.ap.test.value.ExternalOrderType in project mapstruct by mapstruct.
the class EnumToEnumMappingTest method shouldMapAnyRemainingToNullCorrectly.
@IssueKey("1091")
@ProcessorTest
public void shouldMapAnyRemainingToNullCorrectly() {
ExternalOrderType externalOrderType = SpecialOrderMapper.INSTANCE.anyRemainingToNull(OrderType.RETAIL);
assertThat(externalOrderType).isNotNull().isEqualTo(ExternalOrderType.RETAIL);
externalOrderType = SpecialOrderMapper.INSTANCE.anyRemainingToNull(OrderType.B2B);
assertThat(externalOrderType).isNotNull().isEqualTo(ExternalOrderType.B2B);
externalOrderType = SpecialOrderMapper.INSTANCE.anyRemainingToNull(OrderType.EXTRA);
assertThat(externalOrderType).isNull();
externalOrderType = SpecialOrderMapper.INSTANCE.anyRemainingToNull(OrderType.STANDARD);
assertThat(externalOrderType).isNull();
externalOrderType = SpecialOrderMapper.INSTANCE.anyRemainingToNull(OrderType.NORMAL);
assertThat(externalOrderType).isNull();
}
use of org.mapstruct.ap.test.value.ExternalOrderType in project mapstruct by mapstruct.
the class EnumToEnumMappingTest method shouldConsiderConstantMappings.
@ProcessorTest
public void shouldConsiderConstantMappings() {
ExternalOrderType target = OrderMapper.INSTANCE.orderTypeToExternalOrderType(OrderType.EXTRA);
assertThat(target).isEqualTo(ExternalOrderType.SPECIAL);
target = OrderMapper.INSTANCE.orderTypeToExternalOrderType(OrderType.STANDARD);
assertThat(target).isEqualTo(ExternalOrderType.DEFAULT);
target = OrderMapper.INSTANCE.orderTypeToExternalOrderType(OrderType.NORMAL);
assertThat(target).isEqualTo(ExternalOrderType.DEFAULT);
}
Aggregations