Annotation Interface AcrossTestConfiguration
EnableAcrossContext
does, but adds
some test-related configurations. If no datasources are configured, a test datasource will be used.
See the javadoc for TestDataSourceConfigurer
for more information.
WARNING: Do not use this annotation when configuring a context with a real-life database. Using this annotation will add configurers that will reset both the across datasource and optional installer datasource before the context is bootstrapped. All tables in the databases will be dropped.
When used in conjunction with AcrossWebAppConfiguration
, this configuration will also
provide a MockMvc
instance initialized with all filters
registered by Across modules.
Any class marked with this annotation is also marked with Configuration
automatically.
- Since:
- 1.0.0
- See Also:
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
Configures auto configuration of theAcrossContext
.String[]
Array ofAcrossModule
names that should never be resolved through scanning, no matter the values ofscanForRequiredModules()
andscanForOptionalModules()
.Class<?>[]
Specify a collection of types, interfaces or annotations that should be exposed by all modules.Class<?>[]
Type-safe alternative tomoduleConfigurationPackages()
for specifying the packages to scan forModuleConfiguration
classes.String[]
Set of packages that should be scanned forModuleConfiguration
classes.Class<?>[]
Type-safe alternative tomodulePackages()
for specifying the packages to scan for modules.String[]
Set of packages that should be scanned for modules.String[]
Array ofAcrossModule
names that should be configured if auto configuration is enabled.boolean
If auto configuration is enabled, should optional modules be scanned for?boolean
If auto configuration is enabled, should required modules be scanned for?
-
Element Details
-
modules
String[] modulesArray ofAcrossModule
names that should be configured if auto configuration is enabled. These will be added to theAcrossContext
before any configured module beans and before theAcrossContextConfigurer
instances are called.- Default:
- {}
-
excludeFromScanning
String[] excludeFromScanningArray ofAcrossModule
names that should never be resolved through scanning, no matter the values ofscanForRequiredModules()
andscanForOptionalModules()
.- Default:
- {}
-
autoConfigure
boolean autoConfigureConfigures auto configuration of theAcrossContext
. Auto configuration meansAcrossModule
beans from the parentApplicationContext
will be picked up and class path scanning for modules by names will be supported. The configured context will have aClassPathScanningModuleDependencyResolver
set to resolve the module dependencies as well.The ability to disable auto configuration is mainly kept for compatibility reasons.
- Default:
- true
-
scanForRequiredModules
boolean scanForRequiredModulesIf auto configuration is enabled, should required modules be scanned for? All modules configured using themodules()
attribute are considered to be required.- Default:
- true
-
scanForOptionalModules
boolean scanForOptionalModulesIf auto configuration is enabled, should optional modules be scanned for?- Default:
- false
-
modulePackages
String[] modulePackagesSet of packages that should be scanned for modules. If empty the standard modules packages as well as the package of the importing class will be used.- Default:
- {}
-
modulePackageClasses
Class<?>[] modulePackageClassesType-safe alternative tomodulePackages()
for specifying the packages to scan for modules. The package of each class specified will be scanned.Consider creating a special no-op marker class or interface in each package that serves no purpose other than being referenced by this attribute.
- Default:
- {}
-
moduleConfigurationPackages
String[] moduleConfigurationPackagesSet of packages that should be scanned forModuleConfiguration
classes. If empty the sub-packages config and extensions of the importing class will be used.- Default:
- {}
-
moduleConfigurationPackageClasses
Class<?>[] moduleConfigurationPackageClassesType-safe alternative tomoduleConfigurationPackages()
for specifying the packages to scan forModuleConfiguration
classes. The package of each class specified will be scanned.Consider creating a special no-op marker class or interface in each package that serves no purpose other than being referenced by this attribute.
- Default:
- {}
-
expose
Specify a collection of types, interfaces or annotations that should be exposed by all modules. Useful if you want to exposed components only for integration test purposes, especially for dynamic application modules which might not have anything exposed otherwise.- Default:
- {}
-