Class ResultAssert<V,E>

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

@NullMarked public final class ResultAssert<V,E> extends org.assertj.core.api.AbstractAssert<ResultAssert<V,E>, Result<V,E>>
AssertJ assertions for Result.

Obtain instances via DmxFunAssertions.assertThat(Result).

  • Field Summary

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

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

    Modifier and Type
    Method
    Description
    containsError(E expected)
    Verifies that the Result is Err and contains the given error.
    containsValue(V expected)
    Verifies that the Result is Ok and contains the given value.
    Verifies that the Result is Err.
    Verifies that the Result is Ok.

    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

    • isOk

      public ResultAssert<V,E> isOk()
      Verifies that the Result is Ok.
      Returns:
      this assertion for chaining
    • isErr

      public ResultAssert<V,E> isErr()
      Verifies that the Result is Err.
      Returns:
      this assertion for chaining
    • containsValue

      public ResultAssert<V,E> containsValue(V expected)
      Verifies that the Result is Ok and contains the given value.
      Parameters:
      expected - the expected success value
      Returns:
      this assertion for chaining
    • containsError

      public ResultAssert<V,E> containsError(E expected)
      Verifies that the Result is Err and contains the given error.
      Parameters:
      expected - the expected error value
      Returns:
      this assertion for chaining