VarshaRaviCV commented on code in PR #5559:
URL: https://github.com/apache/ozone/pull/5559#discussion_r1386479415


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/upgrade/TestOmVersionManagerRequestFactory.java:
##########
@@ -59,34 +57,7 @@ public void testKeyCreateRequest() throws Exception {
     // Try getting v1 of 'CreateKey'.
     Class<? extends OMClientRequest> requestType =
         omVersionManager.getHandler(CreateKey.name());
-    Assert.assertEquals(requestType, OMKeyCreateRequest.class);
-  }
-
-  @Test
-  public void testAllOMRequestClassesHaveGetRequestTypeMethod()
-      throws Exception {
-    Reflections reflections = new Reflections(
-        "org.apache.hadoop.ozone.om.request");
-    Set<Class<? extends OMClientRequest>> subTypes =
-        reflections.getSubTypesOf(OMClientRequest.class);
-    List<Class<? extends OMClientRequest>> collect = subTypes.stream()
-            .filter(c -> !Modifier.isAbstract(c.getModifiers()))
-            .collect(Collectors.toList());
-
-    for (Class<? extends OMClientRequest> c : collect) {
-      Method getRequestTypeMethod = null;
-      try {
-        getRequestTypeMethod = c.getMethod("getRequestType");
-      } catch (NoSuchMethodException nsmEx) {
-        Assert.fail(String.format(
-            "%s does not have the 'getRequestType' method " +
-            "which should be defined or inherited for every OM request class.",
-            c));
-      }
-      String type = (String) getRequestTypeMethod.invoke(null);
-      Assert.assertNotNull(String.format("Cannot get handler for %s", type),
-          omVersionManager.getHandler(type));
-    }

Review Comment:
   I removed this test case because the getRequestType method is no longer 
there in OM request classes as part of HDDS-5333. Also all the test cases in 
this file are already marked with @Unhealthy and is ignored. 
   When I made the changes to migrate the test cases in this file to Junit5, 
findbugs returned a possible NPE issue with this test case. 
   
   Let me know if I should revert this and make other changes to fix the 
findbug issue.



-- 
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]

Reply via email to