Class Http1DirectJunitExtension
java.lang.Object
io.helidon.webserver.testing.junit5.Http1DirectJunitExtension
- All Implemented Interfaces:
DirectJunitExtension
,HelidonJunitExtension
,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
A Java
ServiceLoader
provider implementation of
DirectJunitExtension
for HTTP/1.1 tests.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.webserver.testing.junit5.spi.DirectJunitExtension
DirectJunitExtension.ParamHandler<T>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterAll
(org.junit.jupiter.api.extension.ExtensionContext context) void
beforeEach
(org.junit.jupiter.api.extension.ExtensionContext context) resolveParameter
(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext, Class<?> paramType) Resolve a parameter.setUpRouteParamHandler
(List<ServerFeature> features, Class<?> type) Check if the type is supported and return a handler for it.boolean
supportsParameter
(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) Does this extension support the provided parameter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.helidon.webserver.testing.junit5.spi.HelidonJunitExtension
afterEach, beforeAll
-
Constructor Details
-
Http1DirectJunitExtension
public Http1DirectJunitExtension()
-
-
Method Details
-
afterAll
public void afterAll(org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
afterAll
in interfaceorg.junit.jupiter.api.extension.AfterAllCallback
- Specified by:
afterAll
in interfaceHelidonJunitExtension
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
beforeEach
in interfaceorg.junit.jupiter.api.extension.BeforeEachCallback
- Specified by:
beforeEach
in interfaceHelidonJunitExtension
-
supportsParameter
public boolean supportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws org.junit.jupiter.api.extension.ParameterResolutionException Description copied from interface:HelidonJunitExtension
Does this extension support the provided parameter.- Specified by:
supportsParameter
in interfaceHelidonJunitExtension
- Parameters:
parameterContext
- parameter contextextensionContext
- extension context- Returns:
true
if the parameter is supported by this extension,false
otherwise- Throws:
org.junit.jupiter.api.extension.ParameterResolutionException
- in case the parameter cannot be correctly resolved
-
resolveParameter
public Object resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext, Class<?> paramType) Description copied from interface:DirectJunitExtension
Resolve a parameter.- Specified by:
resolveParameter
in interfaceDirectJunitExtension
- Parameters:
parameterContext
- JUnit parameter contextextensionContext
- JUnit extension contextparamType
- type of parameter- Returns:
- instance of the parameter
-
setUpRouteParamHandler
public Optional<DirectJunitExtension.ParamHandler<?>> setUpRouteParamHandler(List<ServerFeature> features, Class<?> type) Description copied from interface:DirectJunitExtension
Check if the type is supported and return a handler for it.- Specified by:
setUpRouteParamHandler
in interfaceDirectJunitExtension
- Parameters:
features
-type
- type of the parameter toSetUpRoute
method- Returns:
- parameter handler if the type is supported, empty otherwise
-