Class EitherAssert<L,R>

java.lang.Object
org.assertj.core.api.AbstractAssert<EitherAssert<L,R>, Either<L,R>>
dmx.fun.assertj.EitherAssert<L,R>
Type Parameters:
L - the left value type
R - the right value type
All Implemented Interfaces:
org.assertj.core.api.Assert<EitherAssert<L,R>, Either<L,R>>, org.assertj.core.api.Descriptable<EitherAssert<L,R>>, org.assertj.core.api.ExtensionPoints<EitherAssert<L,R>, Either<L,R>>

@NullMarked public final class EitherAssert<L,R> extends org.assertj.core.api.AbstractAssert<EitherAssert<L,R>, Either<L,R>>
AssertJ assertions for Either.

Obtain instances via DmxFunAssertions.assertThat(Either).

  • Field Summary

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

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

    Modifier and Type
    Method
    Description
    containsLeft(L expected)
    Verifies that the Either is a Left containing the given value.
    containsRight(R expected)
    Verifies that the Either is a Right containing the given value.
    Verifies that the Either is a Left.
    Verifies that the Either is a Right.

    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

    • isRight

      public EitherAssert<L,R> isRight()
      Verifies that the Either is a Right.
      Returns:
      this assertion for chaining
    • isLeft

      public EitherAssert<L,R> isLeft()
      Verifies that the Either is a Left.
      Returns:
      this assertion for chaining
    • containsRight

      public EitherAssert<L,R> containsRight(R expected)
      Verifies that the Either is a Right containing the given value.
      Parameters:
      expected - the expected right value
      Returns:
      this assertion for chaining
    • containsLeft

      public EitherAssert<L,R> containsLeft(L expected)
      Verifies that the Either is a Left containing the given value.
      Parameters:
      expected - the expected left value
      Returns:
      this assertion for chaining