Class ITHttpClient<C>

    • Field Detail

      • server

        public okhttp3.mockwebserver.MockWebServer server
      • client

        protected C client
      • extractor

        protected brave.propagation.TraceContext.Extractor<okhttp3.mockwebserver.RecordedRequest> extractor
    • Constructor Detail

      • ITHttpClient

        public ITHttpClient()
    • Method Detail

      • newClient

        protected abstract C newClient​(int port)
                                throws IOException
        Make sure the client you return has retries disabled.
        Throws:
        IOException
      • propagatesNewTrace

        @Test
        protected void propagatesNewTrace()
                                   throws Exception
        Throws:
        Exception
      • propagatesChildOfCurrentSpan

        @Test
        protected void propagatesChildOfCurrentSpan()
                                             throws IOException
        Throws:
        IOException
      • propagatesUnsampledContext

        @Test
        protected void propagatesUnsampledContext()
                                           throws IOException
        Unlike Brave 3, Brave 4 propagates trace ids even when unsampled
        Throws:
        IOException
      • propagatesBaggage_unsampled

        @Test
        protected void propagatesBaggage_unsampled()
                                            throws IOException
        Throws:
        IOException
      • clientTimestampAndDurationEnclosedByParent

        @Test
        protected void clientTimestampAndDurationEnclosedByParent()
                                                           throws IOException
        This prevents confusion as a blocking client should end before, the start of the next span.
        Throws:
        IOException
      • reportsClientKindToZipkin

        @Test
        protected void reportsClientKindToZipkin()
                                          throws IOException
        Throws:
        IOException
      • defaultSpanNameIsMethodName

        @Test
        protected void defaultSpanNameIsMethodName()
                                            throws IOException
        Throws:
        IOException
      • readsRequestAtResponseTime

        @Test
        protected void readsRequestAtResponseTime()
                                           throws IOException
        Throws:
        IOException
      • supportsPortableCustomization

        @Test
        protected void supportsPortableCustomization()
                                              throws IOException
        Throws:
        IOException
      • addsStatusCodeWhenNotOk

        @Test
        protected void addsStatusCodeWhenNotOk()
                                        throws IOException
        Throws:
        IOException
      • emptyPath

        @Test
        protected void emptyPath()
                          throws IOException
        This tests empty path "" coerces to "/" per RFC 7230 Section 2.7.3
        Throws:
        IOException
      • httpPathTagExcludesQueryParams

        @Test
        protected void httpPathTagExcludesQueryParams()
                                               throws IOException
        Throws:
        IOException
      • setsError_onTransportException

        @Test
        protected void setsError_onTransportException()
      • takeRequest

        protected okhttp3.mockwebserver.RecordedRequest takeRequest()
        Ensures a timeout receiving a request happens before the method timeout
      • extract

        protected brave.propagation.TraceContext extract​(okhttp3.mockwebserver.RecordedRequest request)