Package com.vaadin.browserless.internal
Interface UIFactory
- All Superinterfaces:
Serializable
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Creates the
UI of a Vaadin session.
The factory must return a fresh instance every time. A UI already
attached to a session carries that session's state into the next test, which
is why MockVaadin.createUI refuses one.
Pass an implementation to
BrowserlessApplicationContext.Builder.withUIFactory(UIFactory) to
have tests run against a UI subclass of your own, or to
withServletFactory(…) alongside the routes.
A lambda or a constructor reference such as MockedUI::new is a valid
implementation.
For internal use only. May be renamed or removed in a future release.
-
Method Summary
-
Method Details
-
invoke
UI invoke()Creates a new UI instance.- Returns:
- the new UI; must be a fresh instance every time
-