MonitoringUtils { public static String getMethodUniqueId(final ResourceMethod method) { final String path = method.getParent() != null ? createPath(method.getParent()) : "null"; return method.getProducedTypes().toString() + "|" + method.getConsumedTypes().toString() + "|" + method.getHttpMethod() + "|" + path + "|" + method.getInvocable().getHandlingMethod().getName(); } private  MonitoringUtils(); static String getMethodUniqueId(final ResourceMethod method);  }
@Test public void testGetMethodUniqueId() { final Resource resource = Resource.builder(MyResource.class).build(); Assert.assertEquals("[]|[]|GET|resource|get", MonitoringUtils.getMethodUniqueId(getMethod(resource, "get"))); Assert.assertEquals("[text/html]|[]|GET|resource.sub|subGet", MonitoringUtils.getMethodUniqueId(getMethod(resource, "subGet"))); Assert.assertEquals("[text/html]|[]|GET|resource.sub|subGet", MonitoringUtils.getMethodUniqueId(getMethod(resource, "subGet"))); Assert.assertEquals("[text/xml]|[text/plain]|POST|resource|post", MonitoringUtils.getMethodUniqueId(getMethod(resource, "post"))); }