Top Description Fields Constructors Methods
org.assertj.core.api

public abstract Class AbstractBooleanAssert<SELF extends AbstractBooleanAssert<SELF>>

extends AbstractAssert<SELF extends AbstractBooleanAssert<SELF>, Boolean>
Class Inheritance
Known Direct Subclasses
org.assertj.core.api.BooleanAssert
Type Parameters
<SELF>
the "self" type of this assertion class. Please read "Emulating 'self types' using Java Generics to simplify fluent API implementation" for more details.
Static Imports
org.assertj.core.error.ShouldBeEqual.shouldBeEqual, .ShouldBeFalse.shouldBeFalse, .ShouldBeTrue.shouldBeTrue, .ShouldNotBeEqual.shouldNotBeEqual

Base class for all implementations of assertions for Booleans.
Authors
Alex Ruiz, Yvonne Wang, David DIDIER, Ansgar Konermann, Mikhail Mazursky

Field Summary

Inherited from org.assertj.core.api.AbstractAssert:
actualassertionErrorCreatorconditionscustomRepresentationinfomyselfobjectsprintAssertionsDescriptionthrowUnsupportedExceptionOnEquals

Constructor Summary

AccessConstructor and Description
protected
AbstractBooleanAssert(Boolean actual, Class<?> selfType)

Method Summary

Modifier and TypeMethod and Description
public SELF

Returns:

this assertion object.
isEqualTo
(boolean
the given value to compare the actual value to.
expected
)

Verifies that the actual value is equal to the given one.

public SELF

Returns:

this assertion object.
isFalse
()

Verifies that the actual value is false.

public SELF

Returns:

this assertion object.
isNotEqualTo
(boolean
the given value to compare the actual value to.
other
)

Verifies that the actual value is not equal to the given one.

public SELF

Returns:

this assertion object.
isTrue
()

Verifies that the actual value is true.

public final SELF
usingComparator(Comparator<? super Boolean>
the comparator to use for the incoming assertion checks.
customComparator
)

Overrides org.assertj.core.api.AbstractAssert.usingComparator.

Implements org.assertj.core.api.Assert.usingComparator.

Deprecated Custom Comparator is not supported for Boolean comparison.
Do not use this method.
public final SELF
usingComparator(Comparator<? super Boolean>
the comparator to use for the incoming assertion checks.
customComparator
,
String
comparator description to be used in assertion error messages
customComparatorDescription
)

Overrides org.assertj.core.api.AbstractAssert.usingComparator.

Implements org.assertj.core.api.Assert.usingComparator.

Deprecated Custom Comparator is not supported for Boolean comparison.
Do not use this method.
Inherited from org.assertj.core.api.AbstractAssert:
areEqualasInstanceOfasListassertionErrorasStringdescribedAsdescriptionTextdoesNotHavedoesNotHaveSameClassAsdoesNotHaveSameHashCodeAsdoesNotHaveToStringdoesNotHaveToStringequalsextractingextractingfailurefailureWithActualExpectedfailWithActualExpectedAndMessagefailWithMessagegetWritableAssertionInfohashashCodehasSameClassAshasSameHashCodeAshasToStringhasToStringinBinaryinHexadecimalisisElementOfCustomAssertisEqualToisExactlyInstanceOfisInisInisInstanceOfisInstanceOfAnyisInstanceOfSatisfyingisNotisNotEqualToisNotExactlyInstanceOfisNotInisNotInisNotInstanceOfisNotInstanceOfAnyisNotNullisNotOfAnyClassInisNotSameAsisNullisOfAnyClassInisSameAsmatchesmatchesnewListAssertInstanceoverridingErrorMessageoverridingErrorMessagesatisfiessatisfiessatisfiessatisfiesAnyOfsatisfiesAnyOfsatisfiesAnyOfForProxysatisfiesForProxysetCustomRepresentationsetDescriptionConsumersetPrintAssertionsDescriptionthrowAssertionErrorusingDefaultComparatorusingRecursiveAssertionusingRecursiveAssertionusingRecursiveComparisonusingRecursiveComparisonwithAssertionStatewithFailMessagewithFailMessagewithRepresentationwithThreadDumpOnError

Constructor Detail

AbstractBooleanAssertback to summary
protected AbstractBooleanAssert(Boolean actual, Class<?> selfType)

Method Detail

isEqualToback to summary
public SELF isEqualTo(boolean expected)

Verifies that the actual value is equal to the given one.

Example:

 // assertions succeed:
assertThat(true).isEqualTo(true);
assertThat(Boolean.FALSE).isEqualTo(false);

// assertions fail:
assertThat(true).isEqualTo(false);
assertThat(Boolean.TRUE).isEqualTo(false);
Parameters
expected:boolean

the given value to compare the actual value to.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual value is null.
  • if the actual value is not equal to the given one.
isFalseback to summary
public SELF isFalse()

Verifies that the actual value is false.

Example:

 // assertions succeed:
assertThat(false).isFalse();
assertThat(Boolean.FALSE).isFalse();

// assertions fail:
assertThat(true).isFalse();
assertThat(Boolean.TRUE).isFalse();
Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual value is null.
  • if the actual value is not false.
isNotEqualToback to summary
public SELF isNotEqualTo(boolean other)

Verifies that the actual value is not equal to the given one.

Example:

 // assertions succeed:
assertThat(true).isNotEqualTo(false);
assertThat(Boolean.FALSE).isNotEqualTo(true);

// assertions fail:
assertThat(true).isNotEqualTo(true);
assertThat(Boolean.FALSE).isNotEqualTo(false);
Parameters
other:boolean

the given value to compare the actual value to.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual value is null.
  • if the actual value is equal to the given one.
isTrueback to summary
public SELF isTrue()

Verifies that the actual value is true.

Example:

 // assertions succeed:
assertThat(true).isTrue();
assertThat(Boolean.TRUE).isTrue();

// assertions fail:
assertThat(false).isTrue();
assertThat(Boolean.FALSE).isTrue();
Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual value is null.
  • if the actual value is not true.
usingComparatorback to summary
public final SELF usingComparator(Comparator<? super Boolean> customComparator)

Overrides org.assertj.core.api.AbstractAssert.usingComparator.

Implements org.assertj.core.api.Assert.usingComparator.

Deprecated

Custom Comparator is not supported for Boolean comparison.

Do not use this method.

Parameters
customComparator:Comparator<? super Boolean>

Doc from org.assertj.core.api.Assert.usingComparator.

the comparator to use for the incoming assertion checks.

Returns:SELF

Doc from org.assertj.core.api.Assert.usingComparator.

this assertion object.

Annotations
@Override
@Deprecated
Exceptions
UnsupportedOperationException:
if this method is called.
usingComparatorback to summary
public final SELF usingComparator(Comparator<? super Boolean> customComparator, String customComparatorDescription)

Overrides org.assertj.core.api.AbstractAssert.usingComparator.

Implements org.assertj.core.api.Assert.usingComparator.

Deprecated

Custom Comparator is not supported for Boolean comparison.

Do not use this method.

Parameters
customComparator:Comparator<? super Boolean>

Doc from org.assertj.core.api.Assert.usingComparator.

the comparator to use for the incoming assertion checks.

customComparatorDescription:String

Doc from org.assertj.core.api.Assert.usingComparator.

comparator description to be used in assertion error messages

Returns:SELF

Doc from org.assertj.core.api.Assert.usingComparator.

this assertion object.

Annotations
@Override
@Deprecated
Exceptions
UnsupportedOperationException:
if this method is called.