Class SpringBrowserlessTest

java.lang.Object
com.vaadin.browserless.BaseBrowserlessTest
com.vaadin.browserless.SpringBrowserlessTest
All Implemented Interfaces:
TesterWrappers

@ExtendWith({org.springframework.test.context.junit.jupiter.SpringExtension.class,com.vaadin.browserless.BrowserlessTestConfigExtension.class}) @TestExecutionListeners(listeners=BrowserlessTestSpringLookupInitializer.class, mergeMode=MERGE_WITH_DEFAULTS) public abstract class SpringBrowserlessTest extends BaseBrowserlessTest implements TesterWrappers
Base JUnit 6 class for browserless testing of applications based on Spring Framework. This class provides functionality of the Spring TestContext Framework, in addition to set up a mock Vaadin Spring environment, so that views and components built upon dependency injection and AOP can be correctly be handled during unit testing. Usually when unit testing a UI view it is not needed to bootstrap the whole application. Subclasses can therefore be annotated with @ContextConfiguration or other Spring Testing annotations to load only required component or to provide mock services implementations.
 
 @ContextConfiguration(classes = ViewTestConfig.class)
 class ViewTest extends SpringBrowserlessTest {

 }

 @Configuration
 class ViewTestConfig {
     @Bean
     MyService myService() {
         return new MockMyService();
     }
 }
 
 
Since:
1.0
  • Constructor Details

    • SpringBrowserlessTest

      public SpringBrowserlessTest()
  • Method Details