MapStruct – Implicit Type Conversion

MapStruct – Implicit Type Conversion ”; Previous Next MapStruct handles conversion of type conversions automatically in most of the cases. For example, int to Long or String conversion. Conversion handles null values as well. Following are the some of the important automatic conversions. Between primitive types and Corresponding Wrapper Classes. Between primitive types and String. Between enum types and String. Between BigInt, BigDecimal and String. Between Calendar/Date and XMLGregorianCalendar. Between XMLGregorianCalendar and String. Between Jodas date types and String. Example Open project mapping as updated in Mapping Using Builder chapter in Eclipse. Update StudentEntity.java with following code − StudentEntity.java package com.tutorialspoint.entity; public class StudentEntity { private String id; private String name; private String classVal; private SubjectEntity subject; public String section; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getClassVal() { return classVal; } public void setClassVal(String classVal) { this.classVal = classVal; } public SubjectEntity getSubject() { return subject; } public void setSubject(SubjectEntity subject) { this.subject = subject; } } Student.java is unchanged with following code − Student.java package com.tutorialspoint.model; public class Student { private final String name; private final int id; protected Student(Student.Builder builder) { this.name = builder.name; this.id = builder.id; } public static Student.Builder builder() { return new Student.Builder(); } public static class Builder { private String name; private int id; public Builder name(String name) { this.name = name; return this; } public Builder id(int id) { this.id = id; return this; } public Student create() { return new Student( this ); } } public String getName() { return name; } public int getId() { ret+urn id; } } Update DeliveryAddressMapperTest.java with following code − DeliveryAddressMapperTest.java package com.tutorialspoint.mapping; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; import org.mapstruct.factory.Mappers; import com.tutorialspoint.entity.AddressEntity; import com.tutorialspoint.entity.StudentEntity; import com.tutorialspoint.mapper.DeliveryAddressMapper; import com.tutorialspoint.model.DeliveryAddress; public class DeliveryAddressMapperTest { private DeliveryAddressMapper deliveryAddressMapper = Mappers.getMapper(DeliveryAddressMapper.class); @Test public void testEntityToModel() { StudentEntity student = new StudentEntity(); student.setClassVal(“X”); student.setName(“John”); student.setId(“1”); AddressEntity address = new AddressEntity(); address.setCity(“Y”); address.setState(“Z”); address.setHouseNo(1); DeliveryAddress deliveryAddress = deliveryAddressMapper.getDeliveryAddress(student, address); assertEquals(deliveryAddress.getName(), student.getName()); assertEquals(deliveryAddress.getCity(), address.getCity()); assertEquals(deliveryAddress.getState(), address.getState()); assertEquals(deliveryAddress.getHouseNumber(), address.getHouseNo()); } } Update StudentMapperTest.java with following code − StudentMapperTest.java package com.tutorialspoint.mapping; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; import org.mapstruct.factory.Mappers; import com.tutorialspoint.entity.StudentEntity; import com.tutorialspoint.entity.SubjectEntity; import com.tutorialspoint.mapper.StudentMapper; import com.tutorialspoint.model.Student; public class StudentMapperTest { private StudentMapper studentMapper = Mappers.getMapper(StudentMapper.class); @Test public void testEntityToModel() { StudentEntity entity = new StudentEntity(); entity.setName(“John”); entity.setId(“1”); Student model = studentMapper.getModelFromEntity(entity); assertEquals(entity.getName(), model.getName()); assertEquals(Integer.parseInt(entity.getId()), model.getId()); } @Test public void testModelToEntity() { Student.Builder builder = Student.builder().id(1).name(“John”); Student model = builder.create(); StudentEntity entity = studentMapper.getEntityFromModel(model); assertEquals(entity.getName(), model.getName()); assertEquals(Integer.parseInt(entity.getId()), model.getId()); } } Run the following command to test the mappings. mvn clean test Output Once command is successful. Verify the output. mvn clean test [INFO] Scanning for projects… … [INFO] — maven-surefire-plugin:2.12.4:test (default-test) @ mapping — [INFO] Surefire report directory: mvnmappingtargetsurefire-reports ——————————————————- T E S T S ——————————————————- Running com.tutorialspoint.mapping.DeliveryAddressMapperTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec Running com.tutorialspoint.mapping.StudentMapperTest Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec Results : Tests run: 3, Failures: 0, Errors: 0, Skipped: 0 … Print Page Previous Next Advertisements ”;

MapStruct – Builder

MapStruct – Using Builder ”; Previous Next MapStruct allows to use Builders. We can use Builder frameworks or can use our custom builder. In below example, we are using a custom builder. Example Open project mapping as updated in Mapping Direct Fields chapter in Eclipse. Update Student.java with following code − Student.java package com.tutorialspoint.model; public class Student { private final String name; private final int id; protected Student(Student.Builder builder) { this.name = builder.name; this.id = builder.id; } public static Student.Builder builder() { return new Student.Builder(); } public static class Builder { private String name; private int id; public Builder name(String name) { this.name = name; return this; } public Builder id(int id) { this.id = id; return this; } public Student create() { return new Student( this ); } } public String getName() { return name; } public int getId() { return id; } } Update StudentMapper.java with following code − StudentMapper.java package com.tutorialspoint.mapper; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import com.tutorialspoint.entity.StudentEntity; import com.tutorialspoint.model.Student; @Mapper public interface StudentMapper { Student getModelFromEntity(StudentEntity studentEntity); @Mapping(target=”id”, source=”id”) @Mapping(target=”name”, source=”name”) StudentEntity getEntityFromModel(Student student); } Update StudentMapperTest.java with following code − StudentMapperTest.java package com.tutorialspoint.mapping; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; import org.mapstruct.factory.Mappers; import com.tutorialspoint.entity.StudentEntity; import com.tutorialspoint.entity.SubjectEntity; import com.tutorialspoint.mapper.StudentMapper; import com.tutorialspoint.model.Student; public class StudentMapperTest { private StudentMapper studentMapper = Mappers.getMapper(StudentMapper.class); @Test public void testEntityToModel() { StudentEntity entity = new StudentEntity(); entity.setName(“John”); entity.setId(1); Student model = studentMapper.getModelFromEntity(entity); assertEquals(entity.getName(), model.getName()); assertEquals(entity.getId(), model.getId()); } @Test public void testModelToEntity() { Student.Builder builder = Student.builder().id(1).name(“John”); Student model = builder.create(); StudentEntity entity = studentMapper.getEntityFromModel(model); assertEquals(entity.getName(), model.getName()); assertEquals(entity.getId(), model.getId()); } } Run the following command to test the mappings. mvn clean test Output Once command is successful. Verify the output. mvn clean test [INFO] Scanning for projects… … [INFO] — maven-surefire-plugin:2.12.4:test (default-test) @ mapping — [INFO] Surefire report directory: mvnmappingtargetsurefire-reports ——————————————————- T E S T S ——————————————————- Running com.tutorialspoint.mapping.DeliveryAddressMapperTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec Running com.tutorialspoint.mapping.StudentMapperTest Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec Results : Tests run: 3, Failures: 0, Errors: 0, Skipped: 0 … Print Page Previous Next Advertisements ”;

MapStruct – Mapping Direct Field

MapStruct – Mapping Direct Fields ”; Previous Next MapStruct handles direct fields mapping easily. For example, a Student with section as private property and StudentEntity with section as public property. To have both getter/setter mapping, a property should be public. In case of public final, only getter method will be present for mapping. Now create a mapper interface. We”ll use @InheritInverseConfiguration annotation to copy reverse configuration now. @Mapper public interface StudentMapper { @Mapping(target=”className”, source=”classVal”) @Mapping(target=”subject”, source=”subject.name”) Student getModelFromEntity(StudentEntity studentEntity); @InheritInverseConfiguration StudentEntity getEntityFromModel(Student student); } Example Open project mapping as updated in Mapping Nested Objects chapter in Eclipse. Update StudentEntity.java with following code − StudentEntity.java package com.tutorialspoint.entity; public class StudentEntity { private int id; private String name; private String classVal; private SubjectEntity subject; public String section; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getClassVal() { return classVal; } public void setClassVal(String classVal) { this.classVal = classVal; } public SubjectEntity getSubject() { return subject; } public void setSubject(SubjectEntity subject) { this.subject = subject; } } Update Student.java with following code − Student.java package com.tutorialspoint.model; public class Student { private int id; private String name; private String className; private String subject; private String section; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getClassName() { return className; } public void setClassName(String className) { this.className = className; } public String getSubject() { return subject; } public void setSubject(String subject) { this.subject = subject; } public String getSection() { return section; } public void setSection(String section) { this.section = section; } } Update StudentMapper.java with following code − StudentMapper.java package com.tutorialspoint.mapper; import org.mapstruct.InheritInverseConfiguration; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import com.tutorialspoint.entity.StudentEntity; import com.tutorialspoint.model.Student; @Mapper public interface StudentMapper { @Mapping(target=”className”, source=”classVal”) @Mapping(target=”subject”, source=”subject.name”) Student getModelFromEntity(StudentEntity studentEntity); @InheritInverseConfiguration StudentEntity getEntityFromModel(Student student); } Update StudentMapperTest.java with following code − StudentMapperTest.java package com.tutorialspoint.mapping; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; import org.mapstruct.factory.Mappers; import com.tutorialspoint.entity.StudentEntity; import com.tutorialspoint.entity.SubjectEntity; import com.tutorialspoint.mapper.StudentMapper; import com.tutorialspoint.model.Student; public class StudentMapperTest { private StudentMapper studentMapper = Mappers.getMapper(StudentMapper.class); @Test public void testEntityToModel() { StudentEntity entity = new StudentEntity(); entity.setClassVal(“X”); entity.setName(“John”); entity.setId(1); entity.section = “A”; SubjectEntity subject = new SubjectEntity(); subject.setName(“Computer”); entity.setSubject(subject); Student model = studentMapper.getModelFromEntity(entity); assertEquals(entity.getClassVal(), model.getClassName()); assertEquals(entity.getName(), model.getName()); assertEquals(entity.getId(), model.getId()); assertEquals(entity.getSubject().getName(), model.getSubject()); assertEquals(entity.section, model.getSection()); } @Test public void testModelToEntity() { Student model = new Student(); model.setId(1); model.setName(“John”); model.setClassName(“X”); model.setSubject(“Science”); model.setSection(“A”); StudentEntity entity = studentMapper.getEntityFromModel(model); assertEquals(entity.getClassVal(), model.getClassName()); assertEquals(entity.getName(), model.getName()); assertEquals(entity.getId(), model.getId()); assertEquals(entity.getSubject().getName(), model.getSubject()); assertEquals(entity.section, model.getSection()); } } Run the following command to test the mappings. mvn clean test Output Once command is successful. Verify the output. mvn clean test [INFO] Scanning for projects… … [INFO] — maven-surefire-plugin:2.12.4:test (default-test) @ mapping — [INFO] Surefire report directory: mvnmappingtargetsurefire-reports ——————————————————- T E S T S ——————————————————- Running com.tutorialspoint.mapping.DeliveryAddressMapperTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec Running com.tutorialspoint.mapping.StudentMapperTest Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec Results : Tests run: 3, Failures: 0, Errors: 0, Skipped: 0 … Print Page Previous Next Advertisements ”;

MapStruct – Using constant

MapStruct – Using constant ”; Previous Next MapStruct allows to map a constant value to a property. Syntax @Mapping(target = “target-property”, const = “const-value”) Here target-property − the property for which we are doing the mapping. const-value − mapper will map the const-value to target-property. Following example demonstrates the same. Example Open project mapping as updated in Mapping Using dateFormat chapter in Eclipse. Update CarEntity.java with following code − CarEntity.java package com.tutorialspoint.entity; import java.util.GregorianCalendar; public class CarEntity { private int id; private double price; private GregorianCalendar manufacturingDate; public int getId() { return id; } public void setId(int id) { this.id = id; } public double getPrice() { return price; } public void setPrice(double price) { this.price = price; } public GregorianCalendar getManufacturingDate() { return manufacturingDate; } public void setManufacturingDate(GregorianCalendar manufacturingDate) { this.manufacturingDate = manufacturingDate; } } Update Car.java with following code − Car.java package com.tutorialspoint.model; public class Car { private int id; private String price; private String manufacturingDate; private String brand; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } public String getManufacturingDate() { return manufacturingDate; } public void setManufacturingDate(String manufacturingDate) { this.manufacturingDate = manufacturingDate; } public String getBrand() { return brand; } public void setBrand(String brand) { this.brand = brand; } } Update CarMapper.java with following code − CarMapper.java package com.tutorialspoint.mapper; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import com.tutorialspoint.entity.CarEntity; import com.tutorialspoint.model.Car; @Mapper public interface CarMapper { @Mapping(target = “brand”, constant = “BMW”) @Mapping(source = “price”, target = “price”, numberFormat = “$#.00”) @Mapping(source = “manufacturingDate”, target = “manufacturingDate”, dateFormat = “dd.MM.yyyy”) Car getModelFromEntity(CarEntity carEntity); } Update CarMapperTest.java with following code − CarMapperTest.java package com.tutorialspoint.mapping; import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.GregorianCalendar; import org.junit.jupiter.api.Test; import org.mapstruct.factory.Mappers; import com.tutorialspoint.entity.CarEntity; import com.tutorialspoint.mapper.CarMapper; import com.tutorialspoint.model.Car; public class CarMapperTest { private CarMapper carMapper = Mappers.getMapper(CarMapper.class); @Test public void testEntityToModel() { CarEntity entity = new CarEntity(); entity.setPrice(345000); entity.setId(1); entity.setManufacturingDate(new GregorianCalendar(2015, 3, 5)); Car model = carMapper.getModelFromEntity(entity); assertEquals(model.getPrice(), “$345000.00”); assertEquals(entity.getId(), model.getId()); assertEquals(“05.04.2015”, model.getManufacturingDate()); assertEquals(“BMW”, model.getBrand()); } } Run the following command to test the mappings. mvn clean test Output Once command is successful. Verify the output. mvn clean test [INFO] Scanning for projects… … [INFO] — maven-surefire-plugin:2.12.4:test (default-test) @ mapping — [INFO] Surefire report directory: mvnmappingtargetsurefire-reports ——————————————————- T E S T S ——————————————————- Running com.tutorialspoint.mapping.CarMapperTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.035 sec Running com.tutorialspoint.mapping.DeliveryAddressMapperTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec Running com.tutorialspoint.mapping.StudentMapperTest Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec Results : Tests run: 4, Failures: 0, Errors: 0, Skipped: 0 … Print Page Previous Next Advertisements ”;

MapStruct – Mapping Enum

MapStruct – Mapping Enum ”; Previous Next Mapstruct automatically maps enums. Enums with same name are mapped automatically. In case of different name, we can use @ValueMapping annotation to do the mapping. Syntax @Mapper public interface UtilityMapper { @ValueMapping(source = “EXTRA”, target = “SPECIAL”) PlacedOrderType getEnum(OrderType order); } Following example demonstrates the same. Example Open project mapping as updated in Mapping Stream chapter in Eclipse. Create OrderType.java with following code − OrderType.java package com.tutorialspoint.enums; public enum OrderType { EXTRA, NORMAL, STANDARD } Create PlacedOrderType.java with following code − PlacedOrderType.java package com.tutorialspoint.enums; public enum PlacedOrderType { SPECIAL, NORMAL, STANDARD } Update UtilityMapper.java with following code − UtilityMapper.java package com.tutorialspoint.mapper; import java.util.GregorianCalendar; import java.util.Map; import java.util.stream.Stream; import org.mapstruct.MapMapping; import org.mapstruct.Mapper; import org.mapstruct.ValueMapping; import com.tutorialspoint.enums.OrderType; import com.tutorialspoint.enums.PlacedOrderType; @Mapper public interface UtilityMapper { @MapMapping(valueDateFormat = “dd.MM.yyyy”) Map<String, String> getMap(Map<Long, GregorianCalendar> source); Stream<String> getStream(Stream<Integer> source); @ValueMapping(source = “EXTRA”, target = “SPECIAL”) PlacedOrderType getEnum(OrderType order); } Update UtilityMapperTest.java with following code − UtilityMapperTest.java package com.tutorialspoint.mapping; import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.Arrays; import java.util.GregorianCalendar; import java.util.HashMap; import java.util.Map; import java.util.stream.Stream; import org.junit.jupiter.api.Test; import org.mapstruct.factory.Mappers; import com.tutorialspoint.enums.OrderType; import com.tutorialspoint.enums.PlacedOrderType; import com.tutorialspoint.mapper.UtilityMapper; public class UtilityMapperTest { private UtilityMapper utilityMapper=Mappers.getMapper(UtilityMapper.class); @Test public void testMapMapping() { Map<Long, GregorianCalendar> source = new HashMap<>(); source.put(1L, new GregorianCalendar(2015, 3, 5)); Map<String, String> target = utilityMapper.getMap(source); assertEquals(“05.04.2015”, target.get(“1″)); } @Test public void testGetStream() { Stream<Integer> numbers = Arrays.asList(1, 2, 3, 4).stream(); Stream<String> strings = utilityMapper.getStream(numbers); assertEquals(4, strings.count()); } @Test public void testGetEnum() { PlacedOrderType placedOrderType = utilityMapper.getEnum(OrderType.EXTRA); PlacedOrderType placedOrderType1 = utilityMapper.getEnum(OrderType.NORMAL); PlacedOrderType placedOrderType2 = utilityMapper.getEnum(OrderType.STANDARD); assertEquals(PlacedOrderType.SPECIAL.name(), placedOrderType.name()); assertEquals(PlacedOrderType.NORMAL.name(), placedOrderType1.name()); assertEquals(PlacedOrderType.STANDARD.name(), placedOrderType2.name()); } } Run the following command to test the mappings. mvn clean test Output Once command is successful. Verify the output. mvn clean test [INFO] Scanning for projects… … [INFO] — maven-surefire-plugin:2.12.4:test (default-test) @ mapping — [INFO] Surefire report directory: mvnmappingtargetsurefire-reports ——————————————————- T E S T S ——————————————————- Running com.tutorialspoint.mapping.CarMapperTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.256 sec Running com.tutorialspoint.mapping.DeliveryAddressMapperTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec Running com.tutorialspoint.mapping.StudentMapperTest Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec Running com.tutorialspoint.mapping.UtilityMapperTest Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec Results : Tests run: 7, Failures: 0, Errors: 0, Skipped: 0 … Print Page Previous Next Advertisements ”;

MapStruct – Home

MapStruct Tutorial PDF Version Quick Guide Resources Job Search Discussion The MapStruct is an annotation based code generator/mapper which greatly simplifies the mapping implementations of Java Beans. It follows convention over configuration, uses plain method invocations. MapStruct operations are very fast, type-safe and easy to understand. Audience This tutorial is designed for software programmers who want to learn the basics of MapStruct and its concepts in a simple and easy manner. This tutorial will give you enough understanding on the various functionalities of mapstruct with suitable examples. Prerequisites Before proceeding with this tutorial, you should have a basic understanding of Java Programming Language. Print Page Previous Next Advertisements ”;

MapStruct – Using expression

MapStruct – Using expression ”; Previous Next MapStruct allows to call a conversion method for customized logic. We can use expression to achieve the same where we can pass any java object and call its method to do the conversion. Syntax @Mapping(target = “target-property”, expression = “java(target-method())”) Here target-property − the property for which we are doing the mapping. expression − mapper will call the java method written in the expression. target-method − target-method is the method to be called. In case method is present in different class, use new class-name.target-method() Example Open project mapping as updated in Mapping Using dateFormat chapter in Eclipse. Update CarEntity.java with following code − CarEntity.java package com.tutorialspoint.entity; import java.util.GregorianCalendar; public class CarEntity { private int id; private double price; private GregorianCalendar manufacturingDate; public int getId() { return id; } public void setId(int id) { this.id = id; } public double getPrice() { return price; } public void setPrice(double price) { this.price = price; } public GregorianCalendar getManufacturingDate() { return manufacturingDate; } public void setManufacturingDate(GregorianCalendar manufacturingDate) { this.manufacturingDate = manufacturingDate; } } Update Car.java with following code − Car.java package com.tutorialspoint.model; public class Car { private int id; private String price; private String manufacturingDate; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } public String getManufacturingDate() { return manufacturingDate; } public void setManufacturingDate(String manufacturingDate) { this.manufacturingDate = manufacturingDate; } } Update CarMapper.java with following code − CarMapper.java package com.tutorialspoint.mapper; import java.text.SimpleDateFormat; import java.util.Date; import java.util.GregorianCalendar; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import com.tutorialspoint.entity.CarEntity; import com.tutorialspoint.model.Car; @Mapper public interface CarMapper { @Mapping(source = “price”, target = “price”, numberFormat = “$#.00”) @Mapping(target = “manufacturingDate”, expression = “java(getManufacturingDate(carEntity.getManufacturingDate()))”) Car getModelFromEntity(CarEntity carEntity); default String getManufacturingDate(GregorianCalendar manufacturingDate) { Date d = manufacturingDate.getTime(); SimpleDateFormat sdf = new SimpleDateFormat( “dd.MM.yyyy” ); return sdf.format( d ); } } Update CarMapperTest.java with following code − CarMapperTest.java package com.tutorialspoint.mapping; import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.GregorianCalendar; import org.junit.jupiter.api.Test; import org.mapstruct.factory.Mappers; import com.tutorialspoint.entity.CarEntity; import com.tutorialspoint.mapper.CarMapper; import com.tutorialspoint.model.Car; public class CarMapperTest { private CarMapper carMapper = Mappers.getMapper(CarMapper.class); @Test public void testEntityToModel() { CarEntity entity = new CarEntity(); entity.setPrice(345000); entity.setId(1); entity.setManufacturingDate(new GregorianCalendar(2015, 3, 5)); Car model = carMapper.getModelFromEntity(entity); assertEquals(model.getPrice(), “$345000.00”); assertEquals(entity.getId(), model.getId()); assertEquals(“05.04.2015″, model.getManufacturingDate()); } } Run the following command to test the mappings. mvn clean test Output Once command is successful. Verify the output. mvn clean test [INFO] Scanning for projects… … [INFO] — maven-surefire-plugin:2.12.4:test (default-test) @ mapping — [INFO] Surefire report directory: mvnmappingtargetsurefire-reports ——————————————————- T E S T S ——————————————————- Running com.tutorialspoint.mapping.CarMapperTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.035 sec Running com.tutorialspoint.mapping.DeliveryAddressMapperTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec Running com.tutorialspoint.mapping.StudentMapperTest Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec Results : Tests run: 4, Failures: 0, Errors: 0, Skipped: 0 … Print Page Previous Next Advertisements ”;