-
Hey team, this is a great project to do the snapshot testing in Java world. I noticed in the doc that you support to ignore fields like dates but I didn't find examples about this. So if I would like to ignore some fields in snapshot testing, should I create a new SnapshotSerializer, or it there any other way to achieve that? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, you can use regular Jackson configuration to ignore dates etc. You will need to create a serializer similar to this Hibernate one. Then customise as needed objectMapper.addMixIn(DateTime.class, IgnoreTypeMixin.class);
objectMapper.addMixIn(Instant.class, IgnoreTypeMixin.class);
objectMapper.addMixIn(Date.class, IgnoreTypeMixin.class); Update your
|
Beta Was this translation helpful? Give feedback.
Yes, you can use regular Jackson configuration to ignore dates etc.
You will need to create a serializer similar to this Hibernate one.
https://github.com/origin-energy/java-snapshot-testing#example-hibernateserializer
Then customise as needed
Update your
snapshot.properties
to include the new serializer (alternatively replace the default one)