Package io.micrometer.core.instrument
Class HttpServerTimingInstrumentationVerificationTests
java.lang.Object
io.micrometer.core.instrument.HttpServerTimingInstrumentationVerificationTests
@Incubating(since="1.8.9")
public abstract class HttpServerTimingInstrumentationVerificationTests
extends Object
Verify the instrumentation of an HTTP server has the minimum expected results. See
startInstrumentedServer() for the required specification the instrumented HTTP
server must handle.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classClass containing constants that can be used for implementing the HTTP routes that the instrumented server needs to serve to pass theHttpServerTimingInstrumentationVerificationTests. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected io.micrometer.core.instrument.MeterRegistryMeterRegistryto use for instrumentation verification tests.protected abstract URIStart the instrumented HTTP server to be tested.protected abstract voidStop the instrumented server that was started withstartInstrumentedServer().protected StringA default is provided that should be preferred by new instrumentations.
-
Constructor Details
-
HttpServerTimingInstrumentationVerificationTests
public HttpServerTimingInstrumentationVerificationTests()
-
-
Method Details
-
timerName
A default is provided that should be preferred by new instrumentations. Existing instrumentations that use a different value to maintain backwards compatibility may override this method to run tests with a different name used in assertions.- Returns:
- name of the meter timing http server requests
-
startInstrumentedServer
Start the instrumented HTTP server to be tested. No request body or query parameters will be sent, and any response body will be ignored. The server MUST serve the routes described byHttpServerTimingInstrumentationVerificationTests.InstrumentedRoutes. Constants are available in that class for the routes that will have requests sent to them as part of the TCK. The server MUST NOT have a route for the following:GET /notFound(returns 404 response)
- Returns:
- base URI where the instrumented server is receiving requests. Must end with a slash (/).
- Throws:
Exception- See Also:
-
stopInstrumentedServer
Stop the instrumented server that was started withstartInstrumentedServer().- Throws:
Exception
-
getRegistry
protected io.micrometer.core.instrument.MeterRegistry getRegistry()MeterRegistryto use for instrumentation verification tests.- Returns:
- registry to use
-