Search in sources :

Example 1 with BigDecimalProperty

use of org.mapstruct.ap.test.builtin.bean.BigDecimalProperty in project mapstruct by mapstruct.

the class BuiltInTest method shouldApplyBuiltInOnJAXBElementExtra.

@ProcessorTest
@WithClasses({ JaxbMapper.class, JaxbElementProperty.class })
@WithJavaxJaxb
@IssueKey("1698")
public void shouldApplyBuiltInOnJAXBElementExtra() {
    JaxbElementProperty source = new JaxbElementProperty();
    source.setProp(createJaxb("5"));
    source.publicProp = createJaxb("5");
    BigDecimalProperty target = JaxbMapper.INSTANCE.mapBD(source);
    assertThat(target).isNotNull();
    assertThat(target.getProp()).isEqualTo(new BigDecimal("5"));
    assertThat(target.publicProp).isEqualTo(new BigDecimal("5"));
    JaxbElementProperty source2 = new JaxbElementProperty();
    source2.setProp(createJaxb("5"));
    source2.publicProp = createJaxb("5");
    SomeTypeProperty target2 = JaxbMapper.INSTANCE.mapSomeType(source2);
    assertThat(target2).isNotNull();
    assertThat(target2.publicProp).isNotNull();
    assertThat(target2.getProp()).isNotNull();
}
Also used : BigDecimalProperty(org.mapstruct.ap.test.builtin.bean.BigDecimalProperty) SomeTypeProperty(org.mapstruct.ap.test.builtin.bean.SomeTypeProperty) JaxbElementProperty(org.mapstruct.ap.test.builtin.bean.JaxbElementProperty) BigDecimal(java.math.BigDecimal) WithJavaxJaxb(org.mapstruct.ap.testutil.WithJavaxJaxb) IssueKey(org.mapstruct.ap.testutil.IssueKey) ProcessorTest(org.mapstruct.ap.testutil.ProcessorTest) WithClasses(org.mapstruct.ap.testutil.WithClasses)

Aggregations

BigDecimal (java.math.BigDecimal)1 BigDecimalProperty (org.mapstruct.ap.test.builtin.bean.BigDecimalProperty)1 JaxbElementProperty (org.mapstruct.ap.test.builtin.bean.JaxbElementProperty)1 SomeTypeProperty (org.mapstruct.ap.test.builtin.bean.SomeTypeProperty)1 IssueKey (org.mapstruct.ap.testutil.IssueKey)1 ProcessorTest (org.mapstruct.ap.testutil.ProcessorTest)1 WithClasses (org.mapstruct.ap.testutil.WithClasses)1 WithJavaxJaxb (org.mapstruct.ap.testutil.WithJavaxJaxb)1