Package brave.test.http
Class ITHttpClient<C>
java.lang.Object
brave.test.ITRemote
brave.test.http.ITHttpClient<C>
- Direct Known Subclasses:
ITHttpAsyncClient
public abstract class ITHttpClient<C> extends ITRemote
-
Field Summary
Fields Modifier and Type Field Description protected C
client
protected TraceContext.Extractor<okhttp3.mockwebserver.RecordedRequest>
extractor
protected HttpTracing
httpTracing
okhttp3.mockwebserver.MockWebServer
server
Fields inherited from class brave.test.ITRemote
BAGGAGE_FIELD, BAGGAGE_FIELD_KEY, currentTraceContext, globalTimeout, propagationFactory, spanHandler, testName, tracing
-
Constructor Summary
Constructors Constructor Description ITHttpClient()
-
Method Summary
Modifier and Type Method Description void
addsStatusCodeWhenNotOk()
void
clientTimestampAndDurationEnclosedByParent()
This prevents confusion as a blocking client should end before, the start of the next span.void
close()
Closes the client prior to callingITRemote.close()
protected abstract void
closeClient(C client)
void
customSampler()
void
defaultSpanNameIsMethodName()
protected TraceContext
extract(okhttp3.mockwebserver.RecordedRequest request)
protected abstract void
get(C client, String pathIncludingQuery)
void
httpPathTagExcludesQueryParams()
protected abstract C
newClient(int port)
Make sure the client you return has retries disabled.void
post()
protected abstract void
post(C client, String pathIncludingQuery, String body)
void
propagatesBaggage()
void
propagatesBaggage_unsampled()
void
propagatesChildOfCurrentSpan()
void
propagatesNewTrace()
void
propagatesUnsampledContext()
Unlike Brave 3, Brave 4 propagates trace ids even when unsampledvoid
readsRequestAtResponseTime()
void
redirect()
void
reportsClientKindToZipkin()
void
reportsServerAddress()
void
setsError_onTransportException()
void
setup()
void
spanHandlerSeesError()
void
supportsDeprecatedPortableCustomization()
Deprecated.void
supportsPortableCustomization()
protected okhttp3.mockwebserver.RecordedRequest
takeRequest()
Ensures a timeout receiving a request happens before the method timeoutprotected String
url(String pathIncludingQuery)
Methods inherited from class brave.test.ITRemote
assertChildOf, assertChildOf, assertChildOf, assertNoError, assertNoErrorTag, assertSameIds, assertSequential, assertSpanInInterval, checkForLeakedScopes, currentTraceContextBuilder, newTraceContext, tracingBuilder
-
Field Details
-
server
public okhttp3.mockwebserver.MockWebServer server -
client
-
httpTracing
-
extractor
-
-
Constructor Details
-
ITHttpClient
public ITHttpClient()
-
-
Method Details
-
setup
- Throws:
IOException
-
newClient
Make sure the client you return has retries disabled.- Throws:
IOException
-
closeClient
- Throws:
IOException
-
get
- Throws:
IOException
-
post
- Throws:
IOException
-
close
Closes the client prior to callingITRemote.close()
-
propagatesNewTrace
- Throws:
Exception
-
propagatesChildOfCurrentSpan
- Throws:
IOException
-
propagatesUnsampledContext
Unlike Brave 3, Brave 4 propagates trace ids even when unsampled- Throws:
IOException
-
propagatesBaggage
- Throws:
IOException
-
propagatesBaggage_unsampled
- Throws:
IOException
-
customSampler
- Throws:
IOException
-
clientTimestampAndDurationEnclosedByParent
This prevents confusion as a blocking client should end before, the start of the next span.- Throws:
IOException
-
reportsClientKindToZipkin
- Throws:
IOException
-
reportsServerAddress
- Throws:
IOException
-
defaultSpanNameIsMethodName
- Throws:
IOException
-
readsRequestAtResponseTime
- Throws:
IOException
-
supportsPortableCustomization
- Throws:
IOException
-
supportsDeprecatedPortableCustomization
Deprecated.- Throws:
IOException
-
addsStatusCodeWhenNotOk
- Throws:
IOException
-
redirect
- Throws:
IOException
-
post
- Throws:
IOException
-
httpPathTagExcludesQueryParams
- Throws:
IOException
-
spanHandlerSeesError
- Throws:
IOException
-
setsError_onTransportException
public void setsError_onTransportException() -
url
-
takeRequest
protected okhttp3.mockwebserver.RecordedRequest takeRequest()Ensures a timeout receiving a request happens before the method timeout -
extract
-