Package org.mapstruct.ap.test.builtin.bean

Examples of org.mapstruct.ap.test.builtin.bean.StringProperty


    public void shoulApplyBuiltInOnJAXBElement() throws ParseException, DatatypeConfigurationException {

        JaxbElementProperty source = new JaxbElementProperty();
        source.setProp( createJaxb( "TEST" ) );

        StringProperty target = JaxbMapper.INSTANCE.map( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isEqualTo( "TEST" );
    }
View Full Code Here


    @Test
    @WithClasses({ StringProperty.class, XmlGregorianCalendarProperty.class, StringToXmlGregCalMapper.class })
    public void shouldApplyBuiltInStringToXmlGregCal() throws ParseException, DatatypeConfigurationException {

        StringProperty source = new StringProperty();
        source.setProp( "05.07.1999" );

        XmlGregorianCalendarProperty target = StringToXmlGregCalMapper.INSTANCE.mapAndFormat( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp().toString() ).isEqualTo( "1999-07-05T00:00:00.000+02:00" );

        source.setProp( createLocaleDate( "31-08-1982 10:20:56" ) );

        target = StringToXmlGregCalMapper.INSTANCE.map( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp().toString() ).isEqualTo( "1982-08-31T10:20:00.000+02:00" );
View Full Code Here

    public void shouldApplyBuiltInXmlGregCalToString() throws ParseException, DatatypeConfigurationException {

        XmlGregorianCalendarProperty source = new XmlGregorianCalendarProperty();
        source.setProp( createXmlCal( 1999, 3, 2, 60 ) );

        StringProperty target = XmlGregCalToStringMapper.INSTANCE.mapAndFormat( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp() ).isEqualTo( "02.03.1999" );

        source.setProp( createXmlCal( 1999, 3, 2, 60 ) );

        target = XmlGregCalToStringMapper.INSTANCE.map( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp() ).isEqualTo( "1999-03-02+01:00" );

    }
View Full Code Here

    public void shouldApplyBuiltInOnCalendarToString() throws ParseException, DatatypeConfigurationException {

        CalendarProperty source = new CalendarProperty();
        source.setProp( createCalendar( "02.03.1999" ) );

        StringProperty target = CalendarToStringMapper.INSTANCE.map( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp()).isEqualTo( "02.03.1999" );
    }
View Full Code Here

    @Test
    @WithClasses({ CalendarProperty.class, StringProperty.class, StringToCalendarMapper.class })
    public void shouldApplyBuiltInOnStringToCalendar() throws ParseException, DatatypeConfigurationException {

        StringProperty source = new StringProperty();
        source.setProp( "02.03.1999" );

        CalendarProperty target = StringToCalendarMapper.INSTANCE.map( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp()).isEqualTo( createCalendar( "02.03.1999" ) );
View Full Code Here

TOP

Related Classes of org.mapstruct.ap.test.builtin.bean.StringProperty

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.