Interface ServerJunitExtension

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:
Http1ServerJunitExtension, Http2ServerExtension, WsServerExtension

public interface ServerJunitExtension extends HelidonJunitExtension
Java ServiceLoader provider interface for extending server tests with support for additional injection, such as HTTP/1.1 client.
  • Method Details

    • updateServerBuilder

      default void updateServerBuilder(WebServerConfig.Builder builder)
      Update WebServer builder.
      Parameters:
      builder - builder to update, will be used to build server instance
    • updateListenerBuilder

      default void updateListenerBuilder(String socketName, ListenerConfig.Builder listenerBuilder, Router.RouterBuilder<?> routerBuilder)
      Called for sockets defined by SetUpRoute.
      Parameters:
      socketName - name of the socket
      listenerBuilder - listener configuration builder
      routerBuilder - router builder
    • resolveParameter

      default Object resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext, Class<?> parameterType, WebServer server)
      Parameters:
      parameterContext - JUnit parameter context
      extensionContext - JUnit extension context
      parameterType - type of parameter
      server - webserver instance
      Returns:
      instance of the expected type
    • setUpRouteParamHandler

      default Optional<ServerJunitExtension.ParamHandler<?>> setUpRouteParamHandler(Class<?> type)
      Check if the type is supported and return a handler for it.
      Parameters:
      type - type of the parameter to SetUpRoute method
      Returns:
      parameter handler if the type is supported, empty otherwise