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

public class Http1ServerJunitExtension extends Object implements ServerJunitExtension
Java ServiceLoader provider implementation of a ServerJunitExtension that adds support for HTTP/1.1.
  • Constructor Details

    • Http1ServerJunitExtension

      public Http1ServerJunitExtension()
      Public constructor as required by ServiceLoader.
  • Method Details

    • afterEach

      public void afterEach(org.junit.jupiter.api.extension.ExtensionContext context)
      Specified by:
      afterEach in interface org.junit.jupiter.api.extension.AfterEachCallback
      Specified by:
      afterEach in interface HelidonJunitExtension
    • 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 interface HelidonJunitExtension
      Parameters:
      parameterContext - parameter context
      extensionContext - 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<?> parameterType, WebServer server)
      Description copied from interface: ServerJunitExtension
      Specified by:
      resolveParameter in interface ServerJunitExtension
      Parameters:
      parameterContext - JUnit parameter context
      extensionContext - JUnit extension context
      parameterType - type of parameter
      server - webserver instance
      Returns:
      instance of the expected type
    • setUpRouteParamHandler

      public Optional<ServerJunitExtension.ParamHandler<?>> setUpRouteParamHandler(Class<?> type)
      Description copied from interface: ServerJunitExtension
      Check if the type is supported and return a handler for it.
      Specified by:
      setUpRouteParamHandler in interface ServerJunitExtension
      Parameters:
      type - type of the parameter to SetUpRoute method
      Returns:
      parameter handler if the type is supported, empty otherwise