Class TryAssert<V>

java.lang.Object
org.assertj.core.api.AbstractAssert<TryAssert<V>, Try<V>>
dmx.fun.assertj.TryAssert<V>
Type Parameters:
V - the success value type
All Implemented Interfaces:
org.assertj.core.api.Assert<TryAssert<V>, Try<V>>, org.assertj.core.api.Descriptable<TryAssert<V>>, org.assertj.core.api.ExtensionPoints<TryAssert<V>, Try<V>>

@NullMarked public final class TryAssert<V> extends org.assertj.core.api.AbstractAssert<TryAssert<V>, Try<V>>
AssertJ assertions for Try.

Obtain instances via DmxFunAssertions.assertThat(Try).

  • Field Summary

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

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

    Modifier and Type
    Method
    Description
    containsValue(V expected)
    Verifies that the Try is a Success and contains the given value.
    failsWith(Class<? extends Throwable> exceptionType)
    Verifies that the Try is a Failure caused by an exception of the given type.
    Verifies that the Try is a Failure.
    Verifies that the Try is a Success.

    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

    • isSuccess

      public TryAssert<V> isSuccess()
      Verifies that the Try is a Success.
      Returns:
      this assertion for chaining
    • isFailure

      public TryAssert<V> isFailure()
      Verifies that the Try is a Failure.
      Returns:
      this assertion for chaining
    • containsValue

      public TryAssert<V> containsValue(V expected)
      Verifies that the Try is a Success and contains the given value.
      Parameters:
      expected - the expected value
      Returns:
      this assertion for chaining
    • failsWith

      public TryAssert<V> failsWith(Class<? extends Throwable> exceptionType)
      Verifies that the Try is a Failure caused by an exception of the given type.
      Parameters:
      exceptionType - the expected exception type
      Returns:
      this assertion for chaining