Codota Logo
WingtipsAsyncClientHttpRequestInterceptor.getSubspanSpanName
Code IndexAdd Codota to your IDE (free)

How to use
getSubspanSpanName
method
in
com.nike.wingtips.spring.interceptor.WingtipsAsyncClientHttpRequestInterceptor

Best Java code snippets using com.nike.wingtips.spring.interceptor.WingtipsAsyncClientHttpRequestInterceptor.getSubspanSpanName (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: Nike-Inc/wingtips

@DataProvider(value = {
  "spanNameFromStrategy   |   PATCH           |   spanNameFromStrategy",
  "null                   |   PATCH           |   asyncresttemplate_downstream_call-PATCH",
  "                       |   PATCH           |   asyncresttemplate_downstream_call-PATCH",
  "[whitespace]           |   PATCH           |   asyncresttemplate_downstream_call-PATCH",
  "null                   |   null            |   asyncresttemplate_downstream_call-UNKNOWN_HTTP_METHOD",
}, splitBy = "\\|")
@Test
public void getSubspanSpanName_works_as_expected(
  String strategyResult, HttpMethod httpMethod, String expectedResult
) {
  // given
  if ("[whitespace]".equals(strategyResult)) {
    strategyResult = "  \n\r\t  ";
  }
  initialSpanNameFromStrategy.set(strategyResult);
  doReturn(httpMethod).when(requestMock).getMethod();
  WingtipsAsyncClientHttpRequestInterceptor interceptor = new WingtipsAsyncClientHttpRequestInterceptor(
    true, tagAndNamingStrategy, tagAndNamingAdapterMock
  );
  // when
  String result = interceptor.getSubspanSpanName(requestMock, tagAndNamingStrategy, tagAndNamingAdapterMock);
  // then
  assertThat(result).isEqualTo(expectedResult);
}
origin: Nike-Inc/wingtips

@Test
public void createAsyncSubSpanAndExecute_trigger_null_subspanFinisher_in_catch_block_branch_for_code_coverage() {
  // given
  Tracer.getInstance().startRequestWithRootSpan("someRootSpan");
  TracingState tracingStateBeforeInterceptorCall = TracingState.getCurrentThreadTracingState();
  WingtipsAsyncClientHttpRequestInterceptor interceptorSpy = spy(new WingtipsAsyncClientHttpRequestInterceptor(
    true, tagAndNamingStrategy, tagAndNamingAdapterMock
  ));
  RuntimeException explodingSubspanNameMethodEx =
    new RuntimeException("Intentional exception thrown by getSubspanSpanName()");
  doThrow(explodingSubspanNameMethodEx).when(interceptorSpy).getSubspanSpanName(
    any(HttpRequest.class), any(HttpTagAndSpanNamingStrategy.class), any(HttpTagAndSpanNamingAdapter.class)
  );
  HttpRequestWrapperWithModifiableHeaders wrapperRequest =
    new HttpRequestWrapperWithModifiableHeaders(requestMock);
  byte[] body = new byte[]{42};
  // when
  Throwable ex = catchThrowable(
    () -> interceptorSpy.createAsyncSubSpanAndExecute(wrapperRequest, body, executionMock)
  );
  // then
  assertThat(ex).isSameAs(explodingSubspanNameMethodEx);
  verify(interceptorSpy).getSubspanSpanName(wrapperRequest, tagAndNamingStrategy, tagAndNamingAdapterMock);
  // TracingState should have been reset even though an exception occurred in some unexpected place.
  assertThat(normalizeTracingState(TracingState.getCurrentThreadTracingState()))
    .isEqualTo(normalizeTracingState(tracingStateBeforeInterceptorCall));
}
origin: Nike-Inc/wingtips

  getSubspanSpanName(wrapperRequest, tagAndNamingStrategy, tagAndNamingAdapter),
  Span.SpanPurpose.CLIENT
);
origin: com.nike.wingtips/wingtips-spring

  getSubspanSpanName(wrapperRequest, tagAndNamingStrategy, tagAndNamingAdapter),
  Span.SpanPurpose.CLIENT
);
com.nike.wingtips.spring.interceptorWingtipsAsyncClientHttpRequestInterceptorgetSubspanSpanName

Javadoc

Returns the name that should be used for the subspan surrounding the call. Defaults to whatever HttpTagAndSpanNamingStrategy#getInitialSpanName(Object,HttpTagAndSpanNamingAdapter) returns, with a fallback of HttpRequestTracingUtils#getFallbackSpanNameForHttpRequest(String,String) if the naming strategy returned null or blank string. You can override this method to return something else if you want different behavior and you don't want to adjust the naming strategy or adapter.

Popular methods of WingtipsAsyncClientHttpRequestInterceptor

  • <init>
    Constuctor that lets you define whether downstream calls will be surrounded with a subspan and provi
  • createAsyncSubSpanAndExecute
    Creates a subspan (or new trace if no current span exists) to surround the HTTP request, then return
  • propagateTracingHeadersAndExecute
    Calls WingtipsSpringUtil#propagateTracingHeaders(HttpMessage,Span) to propagate the current span's t
  • intercept

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Collectors (java.util.stream)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now