Examples of CarDto


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

    }

    @Test
    public void shouldMapStringToEnum() {
        //given
        CarDto carDto = new CarDto();
        carDto.setCategory( "CONVERTIBLE" );
        //when
        Car car = CarMapper.INSTANCE.carDtoToCar( carDto );

        //then
        assertThat( car ).isNotNull();
View Full Code Here

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

            new Person( "Bob" ),
            new ArrayList<Person>()
        );

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

        //then
        assertThat( carDto ).isNotNull();
        assertThat( carDto.getMake() ).isEqualTo( car.getMake() );
    }
View Full Code Here

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

            new Person( "Bob" ),
            new ArrayList<Person>()
        );

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

        //then
        assertThat( carDto ).isNotNull();
        assertThat( carDto.getDriver() ).isNotNull();
        assertThat( carDto.getDriver().getName() ).isEqualTo( "Bob" );
    }
View Full Code Here

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

    }

    @Test
    public void shouldReverseMapReferenceAttribute() {
        //given
        CarDto carDto = new CarDto( "Morris", 2, "1980", new PersonDto( "Bob" ), new ArrayList<PersonDto>() );

        //when
        Car car = CarMapper.INSTANCE.carDtoToCar( carDto );

        //then
View Full Code Here

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

            new Person( "Bob" ),
            new ArrayList<Person>()
        );

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

        //then
        assertThat( carDto ).isNotNull();
        assertThat( carDto.getSeatCount() ).isEqualTo( car.getNumberOfSeats() );
    }
View Full Code Here

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

    }

    @Test
    public void shouldConsiderCustomMappingForReverseMapping() {
        //given
        CarDto carDto = new CarDto( "Morris", 2, "1980", new PersonDto( "Bob" ), new ArrayList<PersonDto>() );

        //when
        Car car = CarMapper.INSTANCE.carDtoToCar( carDto );

        //then
        assertThat( car ).isNotNull();
        assertThat( car.getNumberOfSeats() ).isEqualTo( carDto.getSeatCount() );
    }
View Full Code Here

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

            new Person( "Bob" ),
            new ArrayList<Person>()
        );

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

        //then
        assertThat( carDto ).isNotNull();
        assertThat( carDto.getManufacturingYear() ).isEqualTo( "1980" );
    }
View Full Code Here

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

    }

    @Test
    public void shouldApplyConverterForReverseMapping() {
        //given
        CarDto carDto = new CarDto( "Morris", 2, "1980", new PersonDto( "Bob" ), new ArrayList<PersonDto>() );

        //when
        Car car = CarMapper.INSTANCE.carDtoToCar( carDto );

        //then
View Full Code Here

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

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

            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
Copyright © 2018 www.massapi.com. 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.