Class MockVaadinHelper.BrowserlessLookupInitializer

java.lang.Object
com.vaadin.flow.server.startup.LookupServletContainerInitializer
com.vaadin.browserless.mocks.MockVaadinHelper.BrowserlessLookupInitializer
All Implemented Interfaces:
ClassLoaderAwareServletContainerInitializer, jakarta.servlet.ServletContainerInitializer
Enclosing class:
MockVaadinHelper

public static class MockVaadinHelper.BrowserlessLookupInitializer extends LookupServletContainerInitializer
The lookup initializer of the mocked environment.

It extends Vaadin's own with the services a browserless test needs on top of the ones LookupServletContainerInitializer declares in its HandlesTypes annotation — the browserless geolocation client, for one. A test adds services of its own through the lookupServices passed to MockVaadinHelper.createMockContext(java.util.Set).

For internal use only. May be renamed or removed in a future release.

  • Field Details

    • additionalServices

      protected Map<Class<?>,Class<?>> additionalServices
      Services the testing environment wires through the Lookup, mapping a service interface to its default implementation.

      An entry is skipped when the caller already supplied an implementation of that interface. Map an interface to Object to declare a service that has no default but can be hooked in by a test, e.g. Map.of(Service.class, Object.class).

  • Constructor Details

    • BrowserlessLookupInitializer

      public BrowserlessLookupInitializer()
      Creates an initializer registering the browserless environment's own services.
  • Method Details