Class AppBasedWebsocketTestingBase<R extends RequestContext<?>,W extends WebsocketContext<?>>

All Implemented Interfaces:
BeforeAfterClassMethodsProvider, CanBeDisabled, RepeatedClassAfterMethodProvider, TestFailureListener
Direct Known Subclasses:
NoAppWebsocketTestingBase

public abstract class AppBasedWebsocketTestingBase<R extends RequestContext<?>,W extends WebsocketContext<?>> extends AppBasedTestingBase<DefaultRequestContext,W>
Base class for WebSocket testing.
  • Field Details

    • logger

      protected static final org.slf4j.Logger logger
    • spincastHttpClientUtils

      @Inject protected SpincastHttpClientUtils spincastHttpClientUtils
  • Constructor Details

    • AppBasedWebsocketTestingBase

      public AppBasedWebsocketTestingBase()
  • Method Details

    • getExtraOverridingModule

      protected com.google.inject.Module getExtraOverridingModule()
      Description copied from class: AppBasedTestingBase
      Can be overriden with something like :
       return Modules.override(super.getExtraOverridingModule()).with(new SpincastGuiceModuleBase() {
           protected void configure() {
               // ...
           }
       });
       
      Overrides:
      getExtraOverridingModule in class AppBasedTestingBase<DefaultRequestContext,W extends WebsocketContext<?>>
    • getExtraOverridingModule3

      protected com.google.inject.Module getExtraOverridingModule3()
    • getSpincastUndertowConfigImplementation

      protected SpincastUndertowConfig getSpincastUndertowConfigImplementation()
    • getSpincastHttpClientUtils

      protected SpincastHttpClientUtils getSpincastHttpClientUtils()
    • beforeTest

      public void beforeTest()
      Description copied from class: SpincastTestBase
      This method will be called before each test.
      Overrides:
      beforeTest in class SpincastTestBase
    • getServerPingIntervalSeconds

      protected int getServerPingIntervalSeconds()
    • closeAllWebsocketEndpoints

      protected void closeAllWebsocketEndpoints()
    • getWebsocketTestExpectedWebsocketV13AcceptHeaderValue

      protected String getWebsocketTestExpectedWebsocketV13AcceptHeaderValue()
    • getSecSocketKey

      protected String getSecSocketKey()
      Generates a random String for the "Sec-WebSocket-Key" Websocket header.
    • validateIsWebsocketUpgradeHttpResponse

      protected void validateIsWebsocketUpgradeHttpResponse(String path, HttpResponse response)
      Validates the response is a Websocket upgrade permission.
    • validateIsNotWebsocketUpgradeHttpResponse

      protected void validateIsNotWebsocketUpgradeHttpResponse(HttpResponse response)
      Validates the response is NOT a Websocket upgrade permission.
    • websocket

      protected WebsocketRequestBuilder websocket(String pathOrUrl, boolean isFullUrl, boolean isHttps)
      Overrides:
      websocket in class AppBasedTestingBase<DefaultRequestContext,W extends WebsocketContext<?>>
      Parameters:
      sslInfo - If not null, then the initial connection is considered to be HTTPS and Websocket is served using SSL too.