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
chore: Upgrade Mockito and surefire plugin #31073
Conversation
WalkthroughWalkthroughThe modifications involve two primary changes in the test suites of an application. The first change updates the argument type for a method call to ensure type safety, specifically in a utility method dealing with file operations. The second change simplifies mock setup in a test by using a direct method call to check for a no-operation condition, enhancing the clarity and maintainability of the test code. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
ObservationRegistry.ObservationConfig mockObservationConfig = | ||
Mockito.mock(ObservationRegistry.ObservationConfig.class); | ||
Mockito.when(observationRegistry.observationConfig()).thenReturn(mockObservationConfig); | ||
Mockito.when(observationRegistry.isNoop()).thenReturn(true); |
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.
Could you please help explain this change?
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.
Previously, we're mocking the observation config with a mock object. That means any code that calls .observationConfig()
would get the mock object. But then, any code that calls .observationConfig().someMethod()
, is throwing an NPE, since that mock object doesn't have any configured return values.
But since the whole reason we're mocking this is to just disable observation altogather, it's simpler to make isNoop
return true
. In which case, all operations in Observation infrastructure will be disabled and no NPEs should show up.
This is essentially a fix for an NPE that was showing up when I was trying to upgrade Spring.
This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected. |
Upgrading Mockito ahead of upgrading Spring itself.
Summary by CodeRabbit