|
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? |
Answered by
jackmatt2
Nov 9, 2021
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 |
1 reply
Answer selected by
jackmatt2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.propertiesto include the new serializer (alternatively replace the default one)