Class UITestSpringLookupInitializer
- All Implemented Interfaces:
AbstractLookupInitializer
,org.springframework.test.context.TestExecutionListener
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.di.LookupInitializer
LookupInitializer.AppShellPredicateImpl, LookupInitializer.LookupImpl, LookupInitializer.ResourceProviderImpl
-
Field Summary
Fields inherited from class com.vaadin.flow.di.LookupInitializer
ONE_IMPL_REQUIRED, SEVERAL_IMPLS, SPI
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterTestMethod
(org.springframework.test.context.TestContext testContext) void
beforeTestMethod
(org.springframework.test.context.TestContext testContext) void
initialize
(VaadinContext context, Map<Class<?>, Collection<Class<?>>> services, VaadinApplicationInitializationBootstrap bootstrap) Creates a newLookup
instance, initializes it and passes it to the providedbootstrap
.Methods inherited from class com.vaadin.flow.spring.SpringLookupInitializer
createLookup
Methods inherited from class com.vaadin.flow.di.LookupInitializer
ensureService, getDefaultImplementations, instantiate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.test.context.TestExecutionListener
afterTestClass, afterTestExecution, beforeTestClass, beforeTestExecution, prepareTestInstance
-
Constructor Details
-
UITestSpringLookupInitializer
public UITestSpringLookupInitializer()
-
-
Method Details
-
beforeTestMethod
public void beforeTestMethod(org.springframework.test.context.TestContext testContext) throws Exception - Specified by:
beforeTestMethod
in interfaceorg.springframework.test.context.TestExecutionListener
- Throws:
Exception
-
afterTestMethod
public void afterTestMethod(org.springframework.test.context.TestContext testContext) throws Exception - Specified by:
afterTestMethod
in interfaceorg.springframework.test.context.TestExecutionListener
- Throws:
Exception
-
initialize
public void initialize(VaadinContext context, Map<Class<?>, Collection<Class<?>>> services, VaadinApplicationInitializationBootstrap bootstrap) throws jakarta.servlet.ServletExceptionDescription copied from interface:AbstractLookupInitializer
Creates a newLookup
instance, initializes it and passes it to the providedbootstrap
.The method should creates a new initialized
Lookup
instance. In some cases it's not possible to create the instance right away when the method is called. To be able to support this usecase the method contract doesn't require to return theLookup
instance. Instead the created instance should be passed to the providedbootstrap
consumer once the instance is created and completely initialized. Thebootstrap
will start the application initialization which otherwise is postponed until aLookup
becomes available.The implementation must use the provided
bootstrap
to pass theLookup
instance otherwise the web application based on thisLookupInitializer
will never be bootstrapped.The provided
services
map contains service implementations found in application classpath using@HandlesTypes
annotation declared forLookupServletContainerInitializer
.- Specified by:
initialize
in interfaceAbstractLookupInitializer
- Overrides:
initialize
in classSpringLookupInitializer
- Parameters:
context
- a Vaadin context to run initialization forservices
- the map of internal services with their implementations found in the application classpathbootstrap
- the web application bootstrap- Throws:
jakarta.servlet.ServletException
- if initialization failed
-