sadanand48 commented on code in PR #6968:
URL: https://github.com/apache/hadoop/pull/6968#discussion_r1708660889
##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCacheDirectives.java:
##########
@@ -1575,7 +1575,7 @@ public void testNoLookupsWhenNotUsed() throws Exception {
CacheManager cm = cluster.getNamesystem().getCacheManager();
LocatedBlocks locations = Mockito.mock(LocatedBlocks.class);
cm.setCachedLocations(locations);
- Mockito.verifyZeroInteractions(locations);
Review Comment:
``` java
public static void verifyZeroInteractions(Object... mocks)
throws InvocationTargetException, IllegalAccessException,
NoSuchMethodException {
String mockitoVersion =
Mockito.class.getPackage().getSpecificationVersion();
Method verifyInteractions;
if (mockitoVersion.compareTo("4.1.1") < 0){
verifyInteractions =
Mockito.class.getMethod("verifyZeroInteractions",mocks.getClass());
} else {
verifyInteractions =
Mockito.class.getMethod("verifyNoInteractions",mocks.getClass());
}
verifyInteractions.invoke(null,mocks);
}
```
Not tried this but something like this could work. But is it okay to use
reflections ?
--
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]