BaseUIUnitTest.scanPackages() only considers ViewPackages on the test class itself, and not on any of the superclasses. That prevents me to create a single abstract inheritable test class that configures the entire test environment, and forces me to repeat the @ViewPackages annotation on all test classes.
An example of a reusable inheritable test class:
/**
* Fully bootstraps the app, then runs UI unit tests on top of the app.
*/
@SpringBootTest
@ActiveProfiles("test")
@ContextConfiguration(classes = IntegrationTestConfiguration.class)
@EnableConfigurationProperties
@Tag("integrationTest")
@ViewPackages(packages = {"at.salzburgag.myflexbox.customerapp"})
@ExtendWith(TreeOnFailureExtension.class)
public abstract class FastUIIntegrationTest extends SpringUIUnitTest {
}
BaseUIUnitTest.scanPackages()
only considers ViewPackages on the test class itself, and not on any of the superclasses. That prevents me to create a single abstract inheritable test class that configures the entire test environment, and forces me to repeat the@ViewPackages
annotation on all test classes.An example of a reusable inheritable test class: