Package org.approvej.spring
Record Class SpringTestContext
java.lang.Object
java.lang.Record
org.approvej.spring.SpringTestContext
- Record Components:
configuration- theMergedContextConfigurationidentifying the contexttestClasses- the test classes directly using the context, sorted by name; empty for a parent context that is only used in a context hierarchydirtiesContextUsages- theDirtiesContextUsages causing the context to be started again, including those of test classes using a child context
@NullMarked
public record SpringTestContext(org.springframework.test.context.MergedContextConfiguration configuration, List<Class<?>> testClasses, List<DirtiesContextUsage> dirtiesContextUsages)
extends Record
A distinct Spring test application context and the test classes sharing it.
Spring caches test application contexts by their MergedContextConfiguration. All test
classes with an equal configuration share one context, each additional distinct configuration
causes another context to be started.
-
Constructor Summary
ConstructorsConstructorDescriptionSpringTestContext(org.springframework.test.context.MergedContextConfiguration configuration, List<Class<?>> testClasses, List<DirtiesContextUsage> dirtiesContextUsages) Creates a newSpringTestContext. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.test.context.MergedContextConfigurationReturns the value of theconfigurationrecord component.Returns the value of thedirtiesContextUsagesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thetestClassesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SpringTestContext
public SpringTestContext(org.springframework.test.context.MergedContextConfiguration configuration, List<Class<?>> testClasses, List<DirtiesContextUsage> dirtiesContextUsages) Creates a newSpringTestContext.- Parameters:
configuration- theMergedContextConfigurationidentifying the contexttestClasses- the test classes directly using the contextdirtiesContextUsages- theDirtiesContextUsages causing the context to be started again
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
configuration
public org.springframework.test.context.MergedContextConfiguration configuration()Returns the value of theconfigurationrecord component.- Returns:
- the value of the
configurationrecord component
-
testClasses
Returns the value of thetestClassesrecord component.- Returns:
- the value of the
testClassesrecord component
-
dirtiesContextUsages
Returns the value of thedirtiesContextUsagesrecord component.- Returns:
- the value of the
dirtiesContextUsagesrecord component
-