adoroszlai commented on code in PR #5559:
URL: https://github.com/apache/ozone/pull/5559#discussion_r1386525093
##########
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:
Created HDDS-9650 for removing all leftover code related to `getRequestType`.
--
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]