Class GuardAssert<T>

java.lang.Object
org.assertj.core.api.AbstractAssert<GuardAssert<T>, Guard<T>>
dmx.fun.assertj.GuardAssert<T>
Type Parameters:
T - the type of value the guard validates
All Implemented Interfaces:
org.assertj.core.api.Assert<GuardAssert<T>, Guard<T>>, org.assertj.core.api.Descriptable<GuardAssert<T>>, org.assertj.core.api.ExtensionPoints<GuardAssert<T>, Guard<T>>

@NullMarked public final class GuardAssert<T> extends org.assertj.core.api.AbstractAssert<GuardAssert<T>, Guard<T>>
AssertJ assertions for Guard.

Obtain instances via DmxFunAssertions.assertThat(Guard).

  • Field Summary

    Fields inherited from class org.assertj.core.api.AbstractAssert

    actual, info, myself, objects, throwUnsupportedExceptionOnEquals
  • Method Summary

    Modifier and Type
    Method
    Description
    accepts(T value)
    Verifies that the guard accepts (validates successfully) the given value.
    rejects(T value)
    Verifies that the guard rejects (fails validation of) the given value.
    rejectsWithMessage(T value, String message)
    Verifies that the guard rejects the given value and that at least one rejection message contains the expected string.
    rejectsWithMessages(T value, String... messages)
    Verifies that the guard rejects the given value and that for each expected message, at least one rejection message contains it.

    Methods inherited from class org.assertj.core.api.AbstractAssert

    actual, areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingEquals, usingEquals, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.assertj.core.api.Descriptable

    as, as, as, describedAs, describedAs
  • Method Details

    • accepts

      public GuardAssert<T> accepts(T value)
      Verifies that the guard accepts (validates successfully) the given value.
      Parameters:
      value - the value to check
      Returns:
      this assertion for chaining
    • rejects

      public GuardAssert<T> rejects(T value)
      Verifies that the guard rejects (fails validation of) the given value.
      Parameters:
      value - the value to check
      Returns:
      this assertion for chaining
    • rejectsWithMessage

      public GuardAssert<T> rejectsWithMessage(T value, String message)
      Verifies that the guard rejects the given value and that at least one rejection message contains the expected string.
      Parameters:
      value - the value to check
      message - the string expected to appear in at least one rejection message
      Returns:
      this assertion for chaining
    • rejectsWithMessages

      public GuardAssert<T> rejectsWithMessages(T value, String... messages)
      Verifies that the guard rejects the given value and that for each expected message, at least one rejection message contains it.
      Parameters:
      value - the value to check
      messages - the strings each expected to appear in at least one rejection message
      Returns:
      this assertion for chaining