Gradle (Kotlin DSL) Java project demonstrating various MapStruct patterns and recipes with JUnit5.
Simple mapping between PersonEntity and PersonDTO using MapStruct.
Mapping to a Java record-based DTO (PersonDTO is a record).
Demonstrates mapping between different enum types (external -> domain).
Source object uses property-style accessors (firstName() / firstName(String)), target DTO uses standard getters/setters.
Source object uses standard getters/setters, target DTO uses property-style accessors (demonstrates @AfterMapping usage).
Source entity has an Iterable<Item> field where Item exposes property-style accessors; the DTO uses a List<ItemDTO> field. Demonstrates mapping from an Iterable source to a List target and element mapping.
Build, run the sample applications, or run tests with the Gradle wrapper:
# Run the test suite
./gradlew test