Interface DirectJunitExtension
- All Superinterfaces:
org.junit.jupiter.api.extension.AfterAllCallback,org.junit.jupiter.api.extension.AfterEachCallback,org.junit.jupiter.api.extension.BeforeAllCallback,org.junit.jupiter.api.extension.BeforeEachCallback,org.junit.jupiter.api.extension.Extension,HelidonJunitExtension
- All Known Implementing Classes:
Http1DirectJunitExtension,WsDirectExtension
Java
ServiceLoader provider interface for extending unit tests with support for additional injection,
such as Direct HTTP/1.1 client.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceHandler to provide an instance that can be injected as a parameter toSetUpRoutestatic methods. -
Method Summary
Modifier and TypeMethodDescriptiondefault ObjectresolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext, Class<?> parameterType) Resolve a parameter.default Optional<DirectJunitExtension.ParamHandler<?>> setUpRouteParamHandler(List<ServerFeature> features, Class<?> type) Check if the type is supported and return a handler for it.Methods inherited from interface io.helidon.webserver.testing.junit5.spi.HelidonJunitExtension
afterAll, afterEach, beforeAll, beforeEach, supportsParameter
-
Method Details
-
resolveParameter
default Object resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext, Class<?> parameterType) Resolve a parameter.- Parameters:
parameterContext- JUnit parameter contextextensionContext- JUnit extension contextparameterType- type of parameter- Returns:
- instance of the parameter
- Throws:
org.junit.jupiter.api.extension.ParameterResolutionException- in case parameter cannot be resolved
-
setUpRouteParamHandler
default Optional<DirectJunitExtension.ParamHandler<?>> setUpRouteParamHandler(List<ServerFeature> features, Class<?> type) Check if the type is supported and return a handler for it.- Parameters:
features-type- type of the parameter toSetUpRoutemethod- Returns:
- parameter handler if the type is supported, empty otherwise
-