-
-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test Cases For Custom Date Serialization #938
Test Cases For Custom Date Serialization #938
Conversation
Good test case. Custom JSON serializers should have priority over built-in serializers. Since you have already found the place in javers-core where serializers are beeing registered, think about contributing a PR with the fix. But remember, custom serializers manage only how your data are stored in JaversRepository. Diff logic is customized in CustomComparators. |
It may take a couple days as I'm a little pressed for time right now, but I think I could do that. Would it be appropriate to just keep committing to this pull request? |
take your time, |
What do you think of that as a solution? It would be tedious to write the test cases such that they test all the adapters in I tried to generalize it but a lot of the types don't have a constructor valid for something like As it is, at least one type from each of |
It wasn't sitting well with me to leave cases untested, so I wrote tests to verify that the 17 built in adapters I identified and affected could be properly overridden. I tried hard to generalize the tests so there wouldn't need to be 17 new adapter classes for this test, but I couldn't get to a solution that both tested all 17 cases and was fully generalized. |
4924bd9
to
d95e822
Compare
…tering built in adapters
d95e822
to
5bdf3a9
Compare
I'm on holiday, will back to you after a few days |
Indeed, these 17 new adapter classes in the test case are not nice |
I have fixed this test using composition, see https://github.com/javers/javers/pull/942/files |
Clever. I never thought of using the real adapters as delegates. I'll keep that pattern in my back pocket. Thanks! |
👍 thanks for your contribution |
I am new to the open source world and this is the first time I'm writing any groovy. Please attribute any mistakes to ignorance rather than malice