HmsNodeRateLimiterFilter implements ContainerRequestFilter, ContainerResponseFilter { public String extractNodeIdFromEventURI( String requestURI ) { if ( requestURI != null ) { String subStringContainingNodeId = StringUtils.substringAfter( requestURI, "/nme/" ); return extractNodeId( subStringContainingNodeId ); } return null; }  @Override void filter( ContainerRequestContext reqCtx, ContainerResponseContext rspCtx ); @Override void filter( ContainerRequestContext reqCtx ); String extractNodeIdFromEventURI( String requestURI ); String extractNodeIdFromURI( String requestURI, EventComponent component ); String extractNodeId( String uri );  }
@Test public void extractNodeIdFromEventURITest() { HmsNodeRateLimiterFilter hmsNodeRateLimiterFilter = new HmsNodeRateLimiterFilter(); String nodeId = hmsNodeRateLimiterFilter.extractNodeIdFromEventURI( "/hms/event/host/nme/N1/" ); assertNotNull( nodeId ); assertEquals( nodeId, "N1" ); }