spring-framework / org.springframework.test.context.web / WebMergedContextConfiguration

WebMergedContextConfiguration

open class WebMergedContextConfiguration : MergedContextConfiguration

WebMergedContextConfiguration encapsulates the merged context configuration declared on a test class and all of its superclasses via org.springframework.test.context.ContextConfiguration, WebAppConfiguration, and org.springframework.test.context.ActiveProfiles.

WebMergedContextConfiguration extends the contract of MergedContextConfiguration by adding support for the configured via @WebAppConfiguration. This allows the org.springframework.test.context.TestContext to properly cache the corresponding that was loaded using properties of this WebMergedContextConfiguration.

Author
Sam Brannen

Since
3.2

See Also
WebAppConfigurationMergedContextConfigurationorg.springframework.test.context.ContextConfigurationorg.springframework.test.context.ActiveProfilesorg.springframework.test.context.ContextConfigurationAttributesorg.springframework.test.context.SmartContextLoader#loadContext(MergedContextConfiguration)

Constructors

<init>

WebMergedContextConfiguration(mergedConfig: MergedContextConfiguration, resourceBasePath: String)

Create a new WebMergedContextConfiguration instance by copying all properties from the supplied MergedContextConfiguration.

If an empty value is supplied for the resourceBasePath an empty string will be used.

WebMergedContextConfiguration(testClass: Class<*>, locations: Array<String>, classes: Array<Class<*>>, contextInitializerClasses: MutableSet<Class<out ApplicationContextInitializer<*>>>, activeProfiles: Array<String>, propertySourceLocations: Array<String>, propertySourceProperties: Array<String>, resourceBasePath: String, contextLoader: ContextLoader, cacheAwareContextLoaderDelegate: CacheAwareContextLoaderDelegate, parent: MergedContextConfiguration)

Create a new WebMergedContextConfiguration instance for the supplied parameters.

If a null value is supplied for locations, classes, activeProfiles, propertySourceLocations, or propertySourceProperties an empty array will be stored instead. If a null value is supplied for the contextInitializerClasses an empty set will be stored instead. If an empty value is supplied for the resourceBasePath an empty string will be used. Furthermore, active profiles will be sorted, and duplicate profiles will be removed.

WebMergedContextConfiguration(testClass: Class<*>, locations: Array<String>, classes: Array<Class<*>>, contextInitializerClasses: MutableSet<Class<out ApplicationContextInitializer<*>>>, activeProfiles: Array<String>, propertySourceLocations: Array<String>, propertySourceProperties: Array<String>, contextCustomizers: MutableSet<ContextCustomizer>, resourceBasePath: String, contextLoader: ContextLoader, cacheAwareContextLoaderDelegate: CacheAwareContextLoaderDelegate, parent: MergedContextConfiguration)

Create a new WebMergedContextConfiguration instance for the supplied parameters.

If a null value is supplied for locations, classes, activeProfiles, propertySourceLocations, or propertySourceProperties an empty array will be stored instead. If a null value is supplied for contextInitializerClasses or contextCustomizers, an empty set will be stored instead. If an empty value is supplied for the resourceBasePath an empty string will be used. Furthermore, active profiles will be sorted, and duplicate profiles will be removed.

Functions

equals

open fun equals(other: Any?): Boolean

Determine if the supplied object is equal to this WebMergedContextConfiguration instance by comparing both object's locations, annotated classes, context initializer classes, active profiles, resource base path, parents, and the fully qualified names of their ContextLoaders.

getResourceBasePath

open fun getResourceBasePath(): String

Get the resource path to the root directory of the web application for the test class, configured via @WebAppConfiguration.

hashCode

open fun hashCode(): Int

Generate a unique hash code for all properties of this WebMergedContextConfiguration excluding the test class.

toString

open fun toString(): String

Provide a String representation of the test class, locations, annotated classes, context initializer classes, active profiles, property source locations, property source properties, context customizers, resource base path, the name of the ContextLoader, and the parent configuration.