Record Class DirtiesContextUsage

java.lang.Object
java.lang.Record
org.approvej.spring.DirtiesContextUsage
Record Components:
testClass - the test class the annotation applies to
testMethod - the test method the annotation applies to, or null if it applies to the whole test class
annotation - the DirtiesContext annotation

@NullMarked public record DirtiesContextUsage(Class<?> testClass, @Nullable Method testMethod, org.springframework.test.annotation.DirtiesContext annotation) extends Record
A usage of DirtiesContext that causes a Spring test application context to be closed and started again.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DirtiesContextUsage(Class<?> testClass, @Nullable Method testMethod, org.springframework.test.annotation.DirtiesContext annotation)
    Creates an instance of a DirtiesContextUsage record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.test.annotation.DirtiesContext
    Returns the value of the annotation record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the testClass record component.
    @Nullable Method
    Returns the value of the testMethod record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DirtiesContextUsage

      public DirtiesContextUsage(Class<?> testClass, @Nullable Method testMethod, org.springframework.test.annotation.DirtiesContext annotation)
      Creates an instance of a DirtiesContextUsage record class.
      Parameters:
      testClass - the value for the testClass record component
      testMethod - the value for the testMethod record component
      annotation - the value for the annotation record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • testClass

      public Class<?> testClass()
      Returns the value of the testClass record component.
      Returns:
      the value of the testClass record component
    • testMethod

      public @Nullable Method testMethod()
      Returns the value of the testMethod record component.
      Returns:
      the value of the testMethod record component
    • annotation

      public org.springframework.test.annotation.DirtiesContext annotation()
      Returns the value of the annotation record component.
      Returns:
      the value of the annotation record component