Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
109 views
in Technique[技术] by (71.8m points)

java - How to use org.unitils.reflectionassert for unsorted enums?

My test

assertReflectionEquals(expectedDto, dtoMapper.toDto(actual), LENIENT_ORDER);

Both objects are same DTOs without strings instead of enums (!).

paymentTypes expected: [CASH, ON_CREDIT_CARD]
paymentTypes   actual: ["ON_CREDIT_CARD", "CASH"]

paymentTypes[0,0] expected: CASH
paymentTypes[0,0]   actual: "ON_CREDIT_CARD"

paymentTypes[1,0] expected: ON_CREDIT_CARD
paymentTypes[1,0]   actual: "ON_CREDIT_CARD"
  1. How to use LENIENT_ORDER for inner fields?
  2. Why it compares actual as strings?
question from:https://stackoverflow.com/questions/65909494/how-to-use-org-unitils-reflectionassert-for-unsorted-enums

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...