use of org.mapstruct.ap.test.value.OrderType in project mapstruct by mapstruct.
the class EnumToEnumMappingTest method shouldApplyReverseMappings.
@ProcessorTest
public void shouldApplyReverseMappings() {
OrderType result = OrderMapper.INSTANCE.externalOrderTypeToOrderType(ExternalOrderType.SPECIAL);
assertThat(result).isEqualTo(OrderType.EXTRA);
result = OrderMapper.INSTANCE.externalOrderTypeToOrderType(ExternalOrderType.DEFAULT);
assertThat(result).isEqualTo(OrderType.STANDARD);
result = OrderMapper.INSTANCE.externalOrderTypeToOrderType(ExternalOrderType.RETAIL);
assertThat(result).isEqualTo(OrderType.RETAIL);
result = OrderMapper.INSTANCE.externalOrderTypeToOrderType(ExternalOrderType.B2B);
assertThat(result).isEqualTo(OrderType.B2B);
}
use of org.mapstruct.ap.test.value.OrderType in project mapstruct by mapstruct.
the class EnumToEnumMappingTest method shouldApplyDefaultReverseMappings.
@ProcessorTest
public void shouldApplyDefaultReverseMappings() {
OrderType result = SpecialOrderMapper.INSTANCE.externalOrderTypeToOrderType(ExternalOrderType.SPECIAL);
assertThat(result).isEqualTo(OrderType.EXTRA);
result = SpecialOrderMapper.INSTANCE.externalOrderTypeToOrderType(ExternalOrderType.DEFAULT);
assertThat(result).isNull();
result = SpecialOrderMapper.INSTANCE.externalOrderTypeToOrderType(ExternalOrderType.RETAIL);
assertThat(result).isEqualTo(OrderType.RETAIL);
result = SpecialOrderMapper.INSTANCE.externalOrderTypeToOrderType(ExternalOrderType.B2B);
assertThat(result).isEqualTo(OrderType.B2B);
}
use of org.mapstruct.ap.test.value.OrderType in project mapstruct by mapstruct.
the class EnumToEnumThrowExceptionMappingTest method shouldIgnoreThrowExceptionWhenInverseValueMappings.
@IssueKey("2339")
@ProcessorTest
@WithClasses({ OrderThrowExceptionMapper.class, OrderDto.class })
public void shouldIgnoreThrowExceptionWhenInverseValueMappings() {
OrderType target = OrderThrowExceptionMapper.INSTANCE.externalOrderTypeToOrderType(ExternalOrderType.B2B);
assertThat(target).isEqualTo(OrderType.B2B);
}
Aggregations