mapstruct / mapstruct/mapstruct-examples
mapstruct-mapper-repo example bug
Nessuno ha ancora preso questa issue.
- Lingua principale
- Java
- Stelle
- 1.4k
- Fork
- 504
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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!
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con testMapObjectToObject e la definizione di CarMapper menzionata nell’issue. Esegui il test dopo aver applicato gli input descritti per riprodurre entrambi i problemi di mapping, quindi esamina la copertura esistente di nullValuePropertyMappingStrategy e la discussione correlata. Il lavoro è completato quando il comportamento previsto per il numero di posti e per le sorgenti null viene riprodotto dai test di regressione e i test di esempio hanno esito positivo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- testing
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100