diff --git a/server/src/test/java/org/opensearch/rest/DelegatingRestHandlerTests.java b/server/src/test/java/org/opensearch/rest/DelegatingRestHandlerTests.java index 2db6cdac0dd4c..ca802a7784ca0 100644 --- a/server/src/test/java/org/opensearch/rest/DelegatingRestHandlerTests.java +++ b/server/src/test/java/org/opensearch/rest/DelegatingRestHandlerTests.java @@ -35,7 +35,7 @@ public void handleRequest(RestRequest request, RestChannel channel, NodeClient c RestHandler handlerSpy = spy(rh); DelegatingRestHandler drh = new DelegatingRestHandler(handlerSpy); - List overridableMethods = Arrays.stream(RestHandler.class.getDeclaredMethods()) + List overridableMethods = Arrays.stream(RestHandler.class.getMethods()) .filter( m -> !(Modifier.isPrivate(m.getModifiers()) || Modifier.isStatic(m.getModifiers()) || Modifier.isFinal(m.getModifiers())) )