-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix(model): Use SettableBeanProperty.Delegating for jackson delegation #6343
Conversation
Ironically, |
SettableBeanProperty secondDelegateMock = mock(SettableBeanProperty.class, RETURNS_DEEP_STUBS); | ||
doReturn(secondDelegateMock).when(delegateMock).withValueDeserializer(any()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jackson is being smart here, and they have a check whether the new delegate is the same as the old, so a separate one needs to be used to test this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left these tests here for now, since I think they are still useful for verifying that the jackson delegation works as expected. For example, without these, I would not have noticed that isIgnorable
and markAsIgnorable
are not delegated by jackson.
Changes the delegation in SettableBeanPropertyDelegate from a custom implementation to the standard way of implementing a delegating property in jackson. This way, if some jackson module overrides methods that are not delegated explicitely here, they will continue to work. Fixes: fabric8io#6342
…nce instead of null Signed-off-by: Marc Nuri <marc@marcnuri.com>
Signed-off-by: Marc Nuri <marc@marcnuri.com>
…eBeanProperty Includes tests to ensure all methods are implemented in future Jackson versions too. Signed-off-by: Marc Nuri <marc@marcnuri.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thx!
Quality Gate passedIssues Measures |
Description
Fixes: #6342
Changes the delegation in
SettableBeanPropertyDelegate
from a custom implementation to the standard way of implementing a delegating property in jackson. This way, if some jackson module overrides methods that are not delegated explicitely here, they will continue to work.Type of change
test, version modification, documentation, etc.)
Checklist