Class Http1ServerJunitExtension
java.lang.Object
io.helidon.webserver.testing.junit5.Http1ServerJunitExtension
- All Implemented Interfaces:
HelidonJunitExtension, ServerJunitExtension, 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
Java
ServiceLoader provider implementation of
a ServerJunitExtension that adds support for HTTP/1.1.-
Nested Class Summary
Nested classes/interfaces inherited from interface ServerJunitExtension
ServerJunitExtension.ParamHandler<T>Modifier and TypeInterfaceDescriptionstatic interfaceHandler of server test parameters of methods annotated withSetUpRoute. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterEach(org.junit.jupiter.api.extension.ExtensionContext context) resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext, Class<?> parameterType, WebServer server) Resolve a parameter.setUpRouteParamHandler(Class<?> type) Check if the type is supported and return a handler for it.booleansupportsParameter(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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface HelidonJunitExtension
afterAll, beforeAll, beforeEachModifier and TypeMethodDescriptiondefault voidafterAll(org.junit.jupiter.api.extension.ExtensionContext context) default voidbeforeAll(org.junit.jupiter.api.extension.ExtensionContext context) default voidbeforeEach(org.junit.jupiter.api.extension.ExtensionContext context) Methods inherited from interface ServerJunitExtension
updateListenerBuilder, updateServerBuilderModifier and TypeMethodDescriptiondefault voidupdateListenerBuilder(String socketName, ListenerConfig.Builder listenerBuilder, Router.RouterBuilder<?> routerBuilder) Called for sockets defined bySetUpRoute.default voidUpdate WebServer builder.
-
Constructor Details
-
Http1ServerJunitExtension
public Http1ServerJunitExtension()Public constructor as required byServiceLoader.
-
-
Method Details
-
afterEach
public void afterEach(org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
afterEachin interfaceorg.junit.jupiter.api.extension.AfterEachCallback- Specified by:
afterEachin 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:HelidonJunitExtensionDoes this extension support the provided parameter.- Specified by:
supportsParameterin interfaceHelidonJunitExtension- Parameters:
parameterContext- parameter contextextensionContext- extension context- Returns:
trueif the parameter is supported by this extension,falseotherwise- 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<?> parameterType, WebServer server) Description copied from interface:ServerJunitExtensionResolve a parameter. Provide an instance of the parameter. Only called ifHelidonJunitExtension.supportsParameter(org.junit.jupiter.api.extension.ParameterContext, org.junit.jupiter.api.extension.ExtensionContext)returnedtrue.- Specified by:
resolveParameterin interfaceServerJunitExtension- Parameters:
parameterContext- JUnit parameter contextextensionContext- JUnit extension contextparameterType- type of parameterserver- webserver instance- Returns:
- instance of the expected type
-
setUpRouteParamHandler
Description copied from interface:ServerJunitExtensionCheck if the type is supported and return a handler for it.- Specified by:
setUpRouteParamHandlerin interfaceServerJunitExtension- Parameters:
type- type of the parameter toSetUpRoutemethod- Returns:
- parameter handler if the type is supported, empty otherwise
-