Docs

Documentation versions (currently viewingVaadin 25.4 (pre-release))

Quarkus Integration

Quarkus browserless test initialization, dependency injection, test profiles, and security integration.

QuarkusBrowserlessApplicationContext creates an application context that uses Quarkus-specific instantiation for dependency injection into views, in a @QuarkusTest class. The QuarkusBrowserlessTest base class provides the same integration for a single user and window. Tests run in a mocked Vaadin environment even though @QuarkusTest also starts the application and HTTP server.

Test Profiles

@TestProfile selects a QuarkusTestProfile that can override configuration, enable alternative beans, and supply test resources.

The Quarkus integration requires explicit registration of NavigationAccessControl as a UI BeforeEnterListener. A service-init observer can register it for the mocked service. Restricting that observer to MockQuarkusServletService avoids applying test-only setup to the application also started by @QuarkusTest.

Security Integration

When Quarkus Security is active, QuarkusBrowserlessApplicationContext.createSecured() returns a context whose newUser() overloads set the SecurityIdentity of each user: newUser() for an anonymous identity, newUser(String username, String…​ roles) for an authenticated one, and newUser(SecurityIdentity) for a custom identity. The identity is in place before the user’s windows are created and navigate, and the context maintains each user’s identity separately.

QuarkusBrowserlessTest obtains the authentication of its user from SecurityIdentity before UI creation and initial navigation. @TestSecurity supplies test-method authentication for it and requires quarkus-test-security.

61B2F8E5-448E-4C36-82E3-D492712ECE67