Package org.mapstruct.ap.test.complex.target

Examples of org.mapstruct.ap.test.complex.target.CarDto


    }

    @Test
    public void shouldReverseMapIterable() {
        //given
        CarDto car1 = new CarDto( "Morris", 2, "1980", new PersonDto( "Bob" ), new ArrayList<PersonDto>() );
        CarDto car2 = new CarDto( "Railton", 4, "1934", new PersonDto( "Bill" ), new ArrayList<PersonDto>() );

        //when
        List<Car> cars = CarMapper.INSTANCE.carDtosToCars( new ArrayList<CarDto>( Arrays.asList( car1, car2 ) ) );

        //then
View Full Code Here


            new Person( "Bob" ),
            new ArrayList<Person>( Arrays.asList( new Person( "Alice" ), new Person( "Bill" ) ) )
        );

        //when
        CarDto dto = CarMapper.INSTANCE.carToCarDto( car );

        //then
        assertThat( dto ).isNotNull();

        assertThat( dto.getPassengers() ).hasSize( 2 );
        assertThat( dto.getPassengers().get( 0 ).getName() ).isEqualTo( "Alice" );
        assertThat( dto.getPassengers().get( 1 ).getName() ).isEqualTo( "Bill" );
    }
View Full Code Here

TOP

Related Classes of org.mapstruct.ap.test.complex.target.CarDto

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.