Package 

Class SpringUIUnitTest

  • All Implemented Interfaces:
    com.vaadin.testbench.unit.TesterWrappers

    @ExtendWith(value = {SpringExtension.class.class})@TestExecutionListeners(listeners = UITestSpringLookupInitializer.class.class, mergeMode = TestExecutionListeners.MergeMode.MERGE_WITH_DEFAULTS) 
    public abstract class SpringUIUnitTest
    extends UIUnitTest
                        

    Base JUnit 5 class for UI unit testing 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 @org.springframework.test.context.ContextConfiguration or other Spring Testing annotations to load only required component or to provide mock services implementations.

    
    @ContextConfiguration(classes = ViewTestConfig.class)
    class ViewTest extends SpringUIUnitTest {
    
    }
    @Configuration
    class ViewTestConfig {
        @Bean
        MyService myService() {
            return new my MockMyService();
        }
    }
    
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      • Methods inherited from class com.vaadin.testbench.unit.BaseUIUnitTest

        $, $view, fireShortcut, getCurrentView, navigate, test
      • Methods inherited from class com.vaadin.testbench.unit.TesterWrappers

        test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test, test
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail