Package brave.test

Class IntegrationTestSpanHandler

  • All Implemented Interfaces:
    org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.InvocationInterceptor

    public final class IntegrationTestSpanHandler
    extends brave.handler.SpanHandler
    implements org.junit.jupiter.api.extension.InvocationInterceptor
    This is a special span reporter for remote integration tests.

    Ex. The following is similar to our base test class ITRemote:

    {@code
    Since:
    5.12
    See Also:
    TestSpanHandler
    • Nested Class Summary

      • Nested classes/interfaces inherited from class brave.handler.SpanHandler

        brave.handler.SpanHandler.Cause
      • Nested classes/interfaces inherited from interface org.junit.jupiter.api.extension.InvocationInterceptor

        org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<T extends Object>
    • Field Summary

      • Fields inherited from class brave.handler.SpanHandler

        NOOP
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean begin​(brave.propagation.TraceContext context, brave.handler.MutableSpan span, brave.propagation.TraceContext parent)  
      boolean end​(brave.propagation.TraceContext context, brave.handler.MutableSpan span, brave.handler.SpanHandler.Cause cause)  
      boolean handlesAbandoned()  
      void ignoreAnySpans()
      Call this before using an Assumptions.assumeTrue(boolean), when there's a chance a span was finished.
      void interceptTestMethod​(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)  
      brave.handler.MutableSpan takeLocalSpan()
      Blocks until a local span was finished.
      brave.handler.MutableSpan takeRemoteSpan​(brave.Span.Kind kind)
      Blocks until a remote span was finished.
      brave.handler.MutableSpan takeRemoteSpanWithError​(brave.Span.Kind kind)
      Some frameworks swallow exceptions.
      brave.handler.MutableSpan takeRemoteSpanWithError​(brave.Span.Kind kind, Throwable error)
      Like takeRemoteSpan(Kind) except a MutableSpan.error() must equal the given value.
      brave.handler.MutableSpan takeRemoteSpanWithErrorMessage​(brave.Span.Kind kind, String errorMessage)
      Use instead of takeRemoteSpanWithError(Kind, Throwable) when you cannot catch a reference to the actual raised exception during a test.
      brave.handler.MutableSpan takeRemoteSpanWithErrorTag​(brave.Span.Kind kind, String errorTag)
      Like takeRemoteSpan(Kind) except an error tag must match the given value.
      String toString()  
      • Methods inherited from interface org.junit.jupiter.api.extension.InvocationInterceptor

        interceptAfterAllMethod, interceptAfterEachMethod, interceptBeforeAllMethod, interceptBeforeEachMethod, interceptDynamicTest, interceptDynamicTest, interceptTestClassConstructor, interceptTestFactoryMethod, interceptTestTemplateMethod
    • Constructor Detail

      • IntegrationTestSpanHandler

        public IntegrationTestSpanHandler()