Add test to check that sealed unions are serialized the same way as legacy unions#2752
Conversation
Generate changelog in
|
| } | ||
|
|
||
| @Test | ||
| void sealedUnionsAreSerializedTheSameAsLegacyUnions() throws IOException { |
There was a problem hiding this comment.
Here is the test. The remainder of the code is modifying SimpleUnion in ete-service.yml to match the one in example-unions.yml
✅ Successfully generated changelog entry!Need to regenerate?Simply interact with the changelog bot comment again to regenerate these entries. 📋Changelog Preview💡 Improvements
|
dae7e0a to
8f69baf
Compare
8f69baf to
79f7c1d
Compare
|
Sounds good. Moved. |
| assertThat(mapper.writeValueAsString(SimpleUnion.foo("foo"))) | ||
| .isEqualTo(mapper.writeValueAsString(undertow.com.palantir.product.SimpleUnion.foo("foo"))); |
There was a problem hiding this comment.
It's not immediately clear which one is the sealed interface and which one isn't. Should we add some verification that one is sealed and one isn't? (to avoid test refactors breaking our assumptions by making both sealed or both unsealed)
There was a problem hiding this comment.
I'm importing the SimpleUnion from the sealedunions package now
be21559 to
f9ef6ae
Compare
Before this PR
Add a small test to validate that the same Conjure union object is serialized the same way whether using the sealed classes implementation or the legacy implementation.
After this PR
==COMMIT_MSG==
Add test to check that sealed unions are serialized the same way as legacy unions
==COMMIT_MSG==
Possible downsides?