adoroszlai commented on code in PR #5559:
URL: https://github.com/apache/ozone/pull/5559#discussion_r1386961818
##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/upgrade/TestOMUpgradeFinalizer.java:
##########
@@ -249,7 +245,7 @@ private void setupVersionManagerMockToFinalize(
private OMLayoutFeature mockFeature(String name, int version) {
OMLayoutFeature f = mock(OMLayoutFeature.class);
- when(f.name()).thenReturn(name);
+ Mockito.lenient().when(f.name()).thenReturn(name);
Review Comment:
Without that we get errors like:
```
org.mockito.exceptions.misusing.UnnecessaryStubbingException:
Unnecessary stubbings detected.
Clean & maintainable test code requires zero unnecessary code.
Following stubbings are unnecessary (click to navigate to relevant line of
code):
1. -> at
org.apache.hadoop.ozone.om.upgrade.TestOMUpgradeFinalizer.mockFeature(TestOMUpgradeFinalizer.java:249)
Please remove unnecessary stubbings or use 'lenient' strictness. More info:
javadoc for UnnecessaryStubbingException class.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]