Commit 2f07d19
refactor: Phase 16d - Remove IdentifiedObject mappings from MapStruct mappers (#86)
* refactor: Phase 16d - Remove IdentifiedObject mappings from MapStruct mappers
Remove IdentifiedObject field mappings and updateEntity() methods from all MapStruct mappers. The Atom protocol layer now exclusively handles IdentifiedObject metadata (id, uuid, description, published, updated, selfLink, upLink, relatedLinks).
Mapper Changes:
- Remove all IdentifiedObject field mappings (id, uuid, description, published, updated, links)
- Remove updateEntity() methods from all mappers
- Add @mapping(target = "id", ignore = true) to prevent UUID→Long type conflicts
- Mappers now only handle XSD-defined fields
DTO Changes:
- UsageSummaryDto: Remove Atom metadata fields (published, updated, selfLink, upLink, relatedLinks, description)
- ElectricPowerQualitySummaryDto: Remove description field
- Update @XmlType propOrder to match reduced field sets
- Fix convenience constructors to match canonical constructor parameters
Test Enhancements:
- Fix DtoExportServiceImplTest reflection setup (remove obsolete dateTimeMapper)
- Add TimeConfiguration, UsageSummary, and ElectricPowerQualitySummary entries to export test
- Populate all test DTOs with comprehensive meaningful data instead of nulls
- Add assertions to validate XML serialization of all populated fields
- All 6 DtoExportServiceImplTest tests pass
Test Results:
- 580 tests run, 571 pass
- 9 pre-existing Jackson3XmlMarshallingTest failures (AtomContent deserialization - unrelated)
- DtoExportServiceImplTest: 6/6 pass with comprehensive field validation
This completes the separation of concerns between MapStruct mapping (XSD fields only) and Atom protocol handling (metadata fields).
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* refactor: Remove deprecated AtomContentDto and fix Jackson deserialization
- Removed deprecated AtomContentDto class
- Updated AtomEntryDto to handle content directly (payload moved to AtomEntryDto)
- Fixed MigrationVerificationTest to use correct AtomEntryDto constructor
- Added local element names to @JsonSubTypes for Jackson deserialization compatibility
- Updated DtoExportServiceImpl to use EspiIdGeneratorService for UUID5 generation
- Fixed all Jackson3XmlMarshallingTest deserialization issues
- All 580 tests passing with 0 failures and 0 errors
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 948ed09 commit 2f07d19
26 files changed
Lines changed: 618 additions & 723 deletions
File tree
- openespi-common/src
- main/java/org/greenbuttonalliance/espi/common
- dto
- atom
- usage
- mapper
- customer
- usage
- service/impl
- test/java/org/greenbuttonalliance/espi/common
- dto/usage
- mapper/usage
- service/impl
Lines changed: 0 additions & 98 deletions
This file was deleted.
Lines changed: 31 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | 76 | | |
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
83 | | - | |
84 | 82 | | |
85 | 83 | | |
86 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
87 | 103 | | |
88 | | - | |
| 104 | + | |
89 | 105 | | |
90 | 106 | | |
91 | 107 | | |
| |||
122 | 138 | | |
123 | 139 | | |
124 | 140 | | |
125 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
126 | 147 | | |
127 | | - | |
| 148 | + | |
128 | 149 | | |
129 | 150 | | |
130 | | - | |
131 | | - | |
132 | | - | |
| 151 | + | |
133 | 152 | | |
134 | | - | |
| 153 | + | |
| 154 | + | |
135 | 155 | | |
136 | 156 | | |
137 | 157 | | |
| |||
Lines changed: 12 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 50 | | |
54 | 51 | | |
55 | 52 | | |
| |||
181 | 178 | | |
182 | 179 | | |
183 | 180 | | |
184 | | - | |
185 | | - | |
| 181 | + | |
| 182 | + | |
186 | 183 | | |
187 | | - | |
| 184 | + | |
188 | 185 | | |
189 | 186 | | |
190 | | - | |
| 187 | + | |
191 | 188 | | |
192 | 189 | | |
193 | | - | |
194 | 190 | | |
195 | | - | |
196 | | - | |
| 191 | + | |
| 192 | + | |
197 | 193 | | |
198 | 194 | | |
199 | 195 | | |
| |||
0 commit comments