mapstruct-mapper-repo example bug
還沒有人認領這個 Issue。
評估
研究方向
從 issue 中提到的 testMapObjectToObject 和 CarMapper 定義開始。套用所述輸入後執行測試,以重現兩個 mapping 失敗,然後檢查現有的 nullValuePropertyMappingStrategy 覆蓋情況和相關討論。當透過回歸測試重現預期的座位數行為和 null 來源行為,且範例測試通過時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
in testMapObjectToObject add:
carDto.setSetCount(7);
and
Assert.assertEquals(5, carDto.getSeatCount());
test will fail
Also, despite the annotation
@Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
on CarMapper:
in testMapObjectToObject
change
Car car = new Car("Morris", 5, CarType.SPORTS);
to
Car car = new Car("Morris", 5, null);
and add
carDto.setType("anything");
and
Assert.assertEquals("anything", carDto.getType());
test will fail
For the latter, I tried to make sense of your recent change of "don't overwrite target if source is null" pull request, but there was so much discussion on what the annotation should be, I couldn't easily figure out the end result. ;o)
I also can't find a test case in this git repo that covers it. Can you point me to it, if there is one?
Thanks!
- 主要語言
- Java
- 星號
- 1.4k
- 分支
- 504
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
mapstruct/mapstruct-examples 的其他 Issue
-
Java 21 support 未關閉
難度 4/5 3-5 天 新手友好度 35/100
mapstruct/mapstruct-examples#153 · 1 則留言 ·
-
難度 4/5 3-5 天 新手友好度 25/100
mapstruct/mapstruct-examples#149 · 1 則留言 ·
-
mapstruct-protobuf3 use lombok:UnsupportedOperationException(Collections$UnmodifiableCollection) 未關閉
難度 2/5 1-3 小時 新手友好度 45/100
mapstruct/mapstruct-examples#142 ·
-
難度 4/5 3-5 天 新手友好度 15/100
mapstruct/mapstruct-examples#138 ·
-
難度 4/5 3-5 天 新手友好度 25/100
mapstruct/mapstruct-examples#128 · 1 個 reaction ·
查看 mapstruct/mapstruct-examples 的全部 Issue
相似的 Issue
-
area/plugin
難度 2/5 1-3 小時 新手友好度 75/100
kestra-io/plugin-kestra#190 ·
-
難度 2/5 1-3 小時 新手友好度 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
apache/rocketmq-dashboard#5064 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
wso2/dpdp-accelerator#287 ·