-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: split and improve ObjectFieldMapTypeHandlerFactoryTests #5168
Conversation
verify(typeHandlerLibrary, times(1)).getTypeHandler((Type) any()); | ||
verify(typeHandlerLibrary, times(1)).getTypeHandler(eq(TypeInfo.of(Integer.class).getType())); | ||
verify(typeHandlerLibrary, never()).getTypeHandler((Class<Object>) any()); | ||
verify(typeHandlerLibrary, never()).getTypeHandler((TypeInfo<Object>) 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.
I'd like to explain what we are doing here at least once.
Also, I'd move the specific test up (test happy path) and then make the "negative tests" afterwards.
verify(typeHandlerLibrary, times(1)).getTypeHandler((Type) any()); | |
verify(typeHandlerLibrary, times(1)).getTypeHandler(eq(TypeInfo.of(Integer.class).getType())); | |
verify(typeHandlerLibrary, never()).getTypeHandler((Class<Object>) any()); | |
verify(typeHandlerLibrary, never()).getTypeHandler((TypeInfo<Object>) any()); | |
// verify that the expected typehandler was created | |
verify(typeHandlerLibrary, times(1)).getTypeHandler(eq(TypeInfo.of(Integer.class).getType())); | |
// verify that creation was triggered only for the expected typehandler, but not for others | |
// 'getTypeHandler' can be called with either Type, Class, or TypeInfo, and we only expect one call with Type | |
verify(typeHandlerLibrary, times(1)).getTypeHandler((Type) any()); | |
verify(typeHandlerLibrary, never()).getTypeHandler((Class<Object>) any()); | |
verify(typeHandlerLibrary, never()).getTypeHandler((TypeInfo<Object>) any()); |
Failing test |
Once #5154 is merged, we'll need to update the suppression of
UUF_UNUSED_FIELD
spotbugs findings forSingleTypeClass
andMultiTypeClass
.