OpenTracingManager extends Helper { public String sanitizePaths(String baseUri, String resourcePath) { if (baseUri.endsWith("/") && resourcePath.startsWith("/")) { return baseUri.substring(0, baseUri.length()-1) + resourcePath; } if ((!baseUri.endsWith("/")) && (!resourcePath.startsWith("/"))) { return baseUri + "/" + resourcePath; } return baseUri + resourcePath; } OpenTracingManager(Rule rule); Format<TextMap> textMapFormat(); Tracer getTracer(); void startSpanWithParent(SpanBuilder spanBuilder, Span parent); void startSpanWithParent(SpanBuilder spanBuilder, Span parent, String id); void startSpanWithContext(SpanBuilder spanBuilder, SpanContext context); void startSpanWithContext(SpanBuilder spanBuilder, SpanContext context, String id); void startSpan(SpanBuilder spanBuilder); void startSpan(SpanBuilder spanBuilder, String id); void finishSpan(); boolean hasSpan(); boolean hasSpanWithId(String id); boolean isCurrentSpan(String id); Span getSpan(); void suspend(String id); void resume(String id); static void reset(); boolean includePath(String path); String getVariableAsString(String name); void setVariable(String name, Object value); boolean isInstanceOf(Object obj, Class<?> clz); String sanitizePaths(String baseUri, String resourcePath);  }
@Test public void joinedPathsHaveSingleSlash() { OpenTracingManager otm = new OpenTracingManager(null); String result = otm.sanitizePaths("http: assertEquals("http: }
@Test public void noopWhenJoinedPathsAreOk() { OpenTracingManager otm = new OpenTracingManager(null); String result = otm.sanitizePaths("http: assertEquals("http: result = otm.sanitizePaths("http: assertEquals("http: }
@Test public void slashIsAddedWhenNoneExists() { OpenTracingManager otm = new OpenTracingManager(null); String result = otm.sanitizePaths("http: assertEquals("http: }