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

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


    @Test
    @WithClasses({ DateProperty.class, XmlGregorianCalendarProperty.class, DateToXmlGregCalMapper.class })
    public void shouldApplyBuiltInOnDateToXmlGregCal() throws ParseException, DatatypeConfigurationException {

        DateProperty source = new DateProperty();
        source.setProp( createDate( "31-08-1982 10:20:56" ) );

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


    public void shouldApplyBuiltInOnXmlGregCalToDate() throws ParseException, DatatypeConfigurationException {

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

        DateProperty target = XmlGregCalToDateMapper.INSTANCE.map( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp().toString() ).isEqualTo( "Tue Mar 02 00:00:00 CET 1999" );

    }
View Full Code Here

    public void shouldApplyBuiltInOnCalendarToDate() throws ParseException, DatatypeConfigurationException {

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

        DateProperty target = CalendarToDateMapper.INSTANCE.map( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp()).isEqualTo( createCalendar( "02.03.1999" ).getTime());
    }
View Full Code Here

    @Test
    @WithClasses({ CalendarProperty.class, DateProperty.class, DateToCalendarMapper.class })
    public void shouldApplyBuiltInOnDateToCalendar() throws ParseException, DatatypeConfigurationException {

        DateProperty source = new DateProperty();
        source.setProp( new SimpleDateFormat( "dd.MM.yyyy" ).parse( "02.03.1999" ) );

        CalendarProperty target = DateToCalendarMapper.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.DateProperty

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.