Package org.assertj.core.api
Class AbstractOptionalIntAssert<SELF extends AbstractOptionalIntAssert<SELF>>
java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,OptionalInt>
org.assertj.core.api.AbstractOptionalIntAssert<SELF>
- All Implemented Interfaces:
Assert<SELF,
,OptionalInt> Descriptable<SELF>
,ExtensionPoints<SELF,
OptionalInt>
- Direct Known Subclasses:
OptionalIntAssert
public abstract class AbstractOptionalIntAssert<SELF extends AbstractOptionalIntAssert<SELF>>
extends AbstractAssert<SELF,OptionalInt>
Assertions for
OptionalInt
.- Author:
- Jean-Christophe Gay, Alexander Bischof, Grzegorz Piwowarek
-
Field Summary
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractOptionalIntAssert
(OptionalInt actual, Class<?> selfType) -
Method Summary
Modifier and TypeMethodDescriptionhasValue
(int expectedValue) Verifies that the actualOptionalInt
has the value in argument.isEmpty()
Verifies that the actualOptionalInt
is empty.Verifies that there is a value present in the actualOptionalInt
, it's an alias ofisPresent()
.Verifies that the actualOptionalInt
is empty (alias ofisEmpty()
).Verifies that there is a value present in the actualOptionalInt
.Methods inherited from class org.assertj.core.api.AbstractAssert
areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, 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, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.assertj.core.api.Descriptable
as, as, as, describedAs, describedAs
-
Constructor Details
-
AbstractOptionalIntAssert
-
-
Method Details
-
isPresent
Verifies that there is a value present in the actualOptionalInt
.Assertion will pass :
assertThat(OptionalInt.of(10)).isPresent();
Assertion will fail :
assertThat(OptionalInt.empty()).isPresent();
- Returns:
- this assertion object.
- Throws:
AssertionError
- if actual value is empty.AssertionError
- if actual is null.
-
isNotPresent
Verifies that the actualOptionalInt
is empty (alias ofisEmpty()
).Assertion will pass :
Assertion will fail :assertThat(OptionalInt.empty()).isNotPresent();
assertThat(OptionalInt.of(10)).isNotPresent();
- Returns:
- this assertion object.
-
isEmpty
Verifies that the actualOptionalInt
is empty.Assertion will pass :
assertThat(OptionalInt.empty()).isEmpty();
Assertion will fail :
assertThat(OptionalInt.of(10)).isEmpty();
- Returns:
- this assertion object.
- Throws:
AssertionError
- if actual value is present.AssertionError
- if actual is null.
-
isNotEmpty
Verifies that there is a value present in the actualOptionalInt
, it's an alias ofisPresent()
.Assertion will pass :
assertThat(OptionalInt.of(10)).isNotEmpty();
Assertion will fail :
assertThat(OptionalInt.empty()).isNotEmpty();
- Returns:
- this assertion object.
- Throws:
AssertionError
- if actual value is empty.AssertionError
- if actual is null.
-
hasValue
Verifies that the actualOptionalInt
has the value in argument.Assertion will pass :
assertThat(OptionalInt.of(8)).hasValue(8); assertThat(OptionalInt.of(8)).hasValue(Integer.valueOf(8));
Assertion will fail :
assertThat(OptionalInt.empty()).hasValue(8); assertThat(OptionalInt.of(7)).hasValue(8);
- Parameters:
expectedValue
- the expected value inside theOptionalInt
.- Returns:
- this assertion object.
- Throws:
AssertionError
- if actual value is empty.AssertionError
- if actual is null.AssertionError
- if actual has not the value as expected.
-