Package com.vaadin.browserless.mocks
Class MockVaadinHelper.BrowserlessLookupInitializer
java.lang.Object
com.vaadin.flow.server.startup.LookupServletContainerInitializer
com.vaadin.browserless.mocks.MockVaadinHelper.BrowserlessLookupInitializer
- All Implemented Interfaces:
com.vaadin.flow.server.startup.ClassLoaderAwareServletContainerInitializer,jakarta.servlet.ServletContainerInitializer
- Enclosing class:
MockVaadinHelper
public static class MockVaadinHelper.BrowserlessLookupInitializer
extends com.vaadin.flow.server.startup.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 Summary
FieldsModifier and TypeFieldDescriptionServices the testing environment wires through theLookup, mapping a service interface to its default implementation. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an initializer registering the browserless environment's own services. -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<Class<?>> voidupdateServices(Set<Class<?>> services) Adds the default implementation of everyadditionalServicesentry the caller has not already covered.Methods inherited from class com.vaadin.flow.server.startup.LookupServletContainerInitializer
process, requiresLookupMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.server.startup.ClassLoaderAwareServletContainerInitializer
onStartup
-
Field Details
-
additionalServices
Services the testing environment wires through theLookup, 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
Objectto 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
-
updateServices
Adds the default implementation of everyadditionalServicesentry the caller has not already covered.- Parameters:
services- the service implementations to register, modified in place
-
getServiceTypes
- Overrides:
getServiceTypesin classcom.vaadin.flow.server.startup.LookupServletContainerInitializer
-