@Test public void testConvertWeaselBeaconToSpan_withPageLoadBeacon_withBackendTraceId() throws ServletException, IOException { MockHttpServletRequest mockHttpServletRequest = new MockHttpServletRequest(); mockHttpServletRequest.setParameter("ty", "pl"); mockHttpServletRequest.setParameter("d", "518"); mockHttpServletRequest.setParameter("r", "1496751574200"); mockHttpServletRequest.setParameter("ts", "-197"); mockHttpServletRequest.setParameter("t", "a6b5fd025be24191"); final String backendTraceId = "6210be349041096e"; mockHttpServletRequest.setParameter("bt", backendTraceId); final String backendSpanId = "6210be349041096e"; mockHttpServletRequest.setParameter("m_bs", backendSpanId); servlet.doPost(mockHttpServletRequest, new MockHttpServletResponse()); final List<MockSpan> finishedSpans = mockTracer.finishedSpans(); assertThat(finishedSpans).hasSize(1); MockSpan span = finishedSpans.get(0); final String spanIdOfPageloadTrace = B3HeaderFormat.getB3Identifiers(mockTracer, span).getSpanId(); final B3HeaderFormat.B3Identifiers traceIdsOfServerSpan = B3HeaderFormat.B3Identifiers.builder() .traceId(backendTraceId) .spanId(backendSpanId) .build(); final B3HeaderFormat.B3Identifiers newSpanIdentifiers = B3HeaderFormat.B3Identifiers.builder() .traceId(backendTraceId) .spanId(backendSpanId) .parentSpanId(spanIdOfPageloadTrace) .build(); verify(reportingSpanEventListener).update(eq(traceIdsOfServerSpan), eq(newSpanIdentifiers), eq(Collections.emptyMap())); assertSoftly(softly -> softly.assertThat(span.tags()) .containsEntry("type", "pageload") .containsEntry("trace_id", backendTraceId) .doesNotContainEntry(Tags.SAMPLING_PRIORITY.getKey(), 0)); }
@Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { handleRequest(req, resp); }
ClientSpanServlet extends HttpServlet { @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { handleRequest(req, resp); } }
ClientSpanServlet extends HttpServlet { @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { handleRequest(req, resp); } ClientSpanServlet();   ClientSpanServlet(TracingPlugin tracingPlugin, ServletPlugin servletPlugin); }
ClientSpanServlet extends HttpServlet { @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { handleRequest(req, resp); } ClientSpanServlet();   ClientSpanServlet(TracingPlugin tracingPlugin, ServletPlugin servletPlugin);  }
ClientSpanServlet extends HttpServlet { @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { handleRequest(req, resp); } ClientSpanServlet();   ClientSpanServlet(TracingPlugin tracingPlugin, ServletPlugin servletPlugin);   }