Class WsDirectExtension
java.lang.Object
io.helidon.webserver.testing.junit5.websocket.WsDirectExtension
- 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
ServiceLoader provider implementation that adds support for injection of WebSocket related
artifacts, such as DirectWsClient in Helidon WebServer unit tests.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.webserver.testing.junit5.spi.DirectJunitExtension
DirectJunitExtension.ParamHandler<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterAll(org.junit.jupiter.api.extension.ExtensionContext context) resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext, Class<?> parameterType) Resolve a parameter.setUpRouteParamHandler(List<ServerFeature> features, 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.webserver.testing.junit5.spi.HelidonJunitExtension
afterEach, beforeAll, beforeEach
-
Constructor Details
-
WsDirectExtension
public WsDirectExtension()
-
-
Method Details
-
afterAll
public void afterAll(org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
afterAllin interfaceorg.junit.jupiter.api.extension.AfterAllCallback- Specified by:
afterAllin 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) Description copied from interface:DirectJunitExtensionResolve a parameter.- Specified by:
resolveParameterin interfaceDirectJunitExtension- Parameters:
parameterContext- JUnit parameter contextextensionContext- JUnit extension contextparameterType- type of parameter- Returns:
- instance of the parameter
-
setUpRouteParamHandler
public Optional<DirectJunitExtension.ParamHandler<?>> setUpRouteParamHandler(List<ServerFeature> features, Class<?> type) Description copied from interface:DirectJunitExtensionCheck if the type is supported and return a handler for it.- Specified by:
setUpRouteParamHandlerin interfaceDirectJunitExtension- Parameters:
features-type- type of the parameter toSetUpRoutemethod- Returns:
- parameter handler if the type is supported, empty otherwise
-