Mapstruct | MapStruct - Mapping Nested Bean | Spring boot with MapStruct Example

preview_player
Показать описание
Hello friends.
I am Lipsa Patra. I am a software engineer. Welcome to my youtube channel
Easy 2Excel .
In this video we will learn about mapping nested bean using mapstruct.
You can download the entire source code of this project from the below github link.
Github link :
Рекомендации по теме
Комментарии
Автор

hey mam this video is really helpful for us :) thank you so much

saurabheducational
Автор

Thank you very much you helped me a lot)

nastyaguseva
Автор

Thank you for your video! At 15:00 you added "uses = {DepartmentMapper.class}" and the question is how can we mock this nested Mapper. Assume the following scenario.

I am trying to write a unit test for the method saveEmployee which internally uses "employeeRepository" and "EmployeeMapper". Inside the EmployeeServiceTest class I will have to mock the EmployeeRepository and the other objects. The problem is that the EmployeeMapper internally uses the DepartmentMapper and if we just try to Autowire the EmployeeMapper, we will get an error. I need to Autowire the mapper because I want to map an object into another object (CreateEmployeeRequest into EmployeeDTO).

Do you have any suggestion? Thank you in advance!

ainigma
Автор

Wrong term used for String variables.
String is not primitive datatype.

rahulnehul