unit-test-mapper-converter
Originally fromgiuseppe-trisciuoglio/developer-kit
Installation
SKILL.md
Unit Testing Mappers and Converters
Overview
Provides patterns for unit testing MapStruct mappers and custom converter classes. Covers field mapping accuracy, null handling, type conversions, nested object transformations, bidirectional mapping, enum mapping, and partial updates.
When to Use
- Writing mapping tests for MapStruct mapper implementations
- Testing custom entity-to-DTO converters and bean mappings
- Validating nested object mapping and collection transformations
Instructions
1. Validate Generated Mapper Classes
Before testing, verify generated mapper classes exist:
# Maven
ls target/generated-sources/