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

public abstract Class AbstractBigDecimalAssert<SELF extends AbstractBigDecimalAssert<SELF>>

extends AbstractComparableAssert<SELF extends AbstractBigDecimalAssert<SELF>, BigDecimal>
implements NumberAssert<SELF extends AbstractBigDecimalAssert<SELF>, BigDecimal>
Class Inheritance
All Implemented Interfaces
org.assertj.core.api.NumberAssert
Known Direct Subclasses
org.assertj.core.api.BigDecimalAssert
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
java.util.Objects.requireNonNull

Base class for all implementations of assertions for BigDecimals.
Authors
Drummond Dawson, David DIDIER, Ted M. Young, Yvonne Wang, Alex Ruiz, Joel Costigliola, Mikhail Mazursky

Field Summary

Modifier and TypeField and Description
pack-priv BigDecimals
Inherited from org.assertj.core.api.AbstractComparableAssert:
comparables

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public SELF

Returns:

this assertion object.
hasScaleOf
(int
the expected scale value.
expectedScale
)

Verifies the BigDecimal under test has the given scale.

public SELF
isBetween(BigDecimal
the start value (inclusive), expected not to be null.
start
,
BigDecimal
the end value (inclusive), expected not to be null.
end
)

Overrides org.assertj.core.api.AbstractComparableAssert.isBetween.

Implements org.assertj.core.api.NumberAssert.isBetween, org.assertj.core.api.ComparableAssert.isBetween.

Verifies that the actual value is in [start, end] range (start and end included).
public SELF

Returns:

this assertion object.
isCloseTo
(final BigDecimal
the given number to compare the actual value to.
expected
,
final Offset<BigDecimal>
the given positive offset.
offset
)

Implements org.assertj.core.api.NumberAssert.isCloseTo.

Verifies that the actual number is close to the given one within the given offset value.
public SELF

Returns:

this assertion object.
isCloseTo
(BigDecimal
the given number to compare the actual value to.
expected
,
Percentage
the given positive percentage.
percentage
)

Implements org.assertj.core.api.NumberAssert.isCloseTo.

Verifies that the actual number is close to the given one within the given percentage.
public SELF

Returns:

this assertion object.
isEqualByComparingTo
(String
the expected BigDecimal passed as a String
expected
)

Overrides org.assertj.core.api.AbstractComparableAssert.isEqualByComparingTo.

Implements org.assertj.core.api.ComparableAssert.isEqualByComparingTo.

Same as isEqualByComparingTo(BigDecimal) but takes care of converting given String to BigDecimal.
public SELF

Returns:

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

Same as isEqualTo(BigDecimal) but takes care of converting given String to BigDecimal for you.

public SELF

Returns:

this assertion object.
isGreaterThanOrEqualTo
(BigDecimal
the given value to compare the actual value to.
other
)

Overrides org.assertj.core.api.AbstractComparableAssert.isGreaterThanOrEqualTo.

Implements org.assertj.core.api.ComparableAssert.isGreaterThanOrEqualTo.

Verifies that the actual value is greater than or equal to the given one.
public SELF

Returns:

this assertion object.
isLessThanOrEqualTo
(BigDecimal
the given value to compare the actual value to.
other
)

Overrides org.assertj.core.api.AbstractComparableAssert.isLessThanOrEqualTo.

Implements org.assertj.core.api.ComparableAssert.isLessThanOrEqualTo.

Verifies that the actual value is less than or equal to the given one.
public SELF
isNegative()

Implements org.assertj.core.api.NumberAssert.isNegative.

Verifies that the actual value is negative.
public SELF

Returns:

this assertion object.
isNotCloseTo
(final BigDecimal
the given number to compare the actual value to.
expected
,
final Offset<BigDecimal>
the given positive offset.
offset
)

Implements org.assertj.core.api.NumberAssert.isNotCloseTo.

Verifies that the actual number is not close to the given one by less than the given offset.
public SELF

Returns:

this assertion object.
isNotCloseTo
(BigDecimal
the given number to compare the actual value to.
expected
,
Percentage
the given positive percentage.
percentage
)

Implements org.assertj.core.api.NumberAssert.isNotCloseTo.

Verifies that the actual number is not close to the given one by the given percentage.
public SELF

Returns:

this assertion object.
isNotEqualByComparingTo
(String
the BigDecimal value passed as a String not to expect.
notExpected
)

Overrides org.assertj.core.api.AbstractComparableAssert.isNotEqualByComparingTo.

Implements org.assertj.core.api.ComparableAssert.isNotEqualByComparingTo.

Same as isNotEqualByComparingTo(BigDecimal) but takes care of converting given String to BigDecimal.
public SELF
isNotNegative()

Implements org.assertj.core.api.NumberAssert.isNotNegative.

Verifies that the actual value is non negative (positive or equal zero).
public SELF
isNotPositive()

Implements org.assertj.core.api.NumberAssert.isNotPositive.

Verifies that the actual value is non positive (negative or equal zero).
public SELF
isNotZero()

Implements org.assertj.core.api.NumberAssert.isNotZero.

Verifies that the actual value is not equal to zero.
public SELF
isOne()

Implements org.assertj.core.api.NumberAssert.isOne.

Verifies that the actual value is equal to one.
public SELF
isPositive()

Implements org.assertj.core.api.NumberAssert.isPositive.

Verifies that the actual value is positive.
public SELF
isStrictlyBetween(BigDecimal
the start value (exclusive), expected not to be null.
start
,
BigDecimal
the end value (exclusive), expected not to be null.
end
)

Overrides org.assertj.core.api.AbstractComparableAssert.isStrictlyBetween.

Implements org.assertj.core.api.NumberAssert.isStrictlyBetween, org.assertj.core.api.ComparableAssert.isStrictlyBetween.

Verifies that the actual value is in ]start, end[ range (start excluded, end excluded).
public SELF
isZero()

Implements org.assertj.core.api.NumberAssert.isZero.

Verifies that the actual value is equal to zero.
public AbstractBigDecimalScaleAssert<SELF>

Returns:

AbstractBigDecimalScaleAssert built with the BigDecimal's scale.
scale
()

Returns an Assert object that allows performing assertions on the scale of the BigDecimal under test.

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

Overrides org.assertj.core.api.AbstractComparableAssert.usingComparator.

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

Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks.
public SELF
usingComparator(Comparator<? super BigDecimal>
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.AbstractComparableAssert.usingComparator.

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

Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks.
public SELF
Inherited from org.assertj.core.api.AbstractComparableAssert:
inBinaryinHexadecimalisGreaterThanisLessThan

Field Detail

bigDecimalsback to summary
pack-priv BigDecimals bigDecimals
Annotations
@VisibleForTesting

Constructor Detail

AbstractBigDecimalAssertback to summary
protected AbstractBigDecimalAssert(BigDecimal actual, Class<?> selfType)

Method Detail

hasScaleOfback to summary
public SELF hasScaleOf(int expectedScale)

Verifies the BigDecimal under test has the given scale.

Example:

 // assertions will pass
assertThat(new BigDecimal("8.00")).hasScaleOf(2);
assertThat(new BigDecimal("8.00").setScale(4)).hasScaleOf(4);

// assertion will fail
assertThat(new BigDecimal("8.00")).hasScaleOf(3);
assertThat(new BigDecimal("8.00").setScale(4)).hasScaleOf(2);
Parameters
expectedScale:int

the expected scale value.

Returns:SELF

this assertion object.

isBetweenback to summary
public SELF isBetween(BigDecimal start, BigDecimal end)

Overrides org.assertj.core.api.AbstractComparableAssert.isBetween.

Implements org.assertj.core.api.NumberAssert.isBetween, org.assertj.core.api.ComparableAssert.isBetween.

Verifies that the actual value is in [start, end] range (start and end included).

Example:

 // assertions will pass
assertThat(new BigDecimal("8.0")).isBetween(new BigDecimal("7.0"), new BigDecimal("9.0"));
assertThat(new BigDecimal("8.00")).isBetween(new BigDecimal("7.0"), new BigDecimal("9.0"));
assertThat(new BigDecimal("8.0")).isBetween(new BigDecimal("8.0"), new BigDecimal("9.0"));
assertThat(new BigDecimal("8.0")).isBetween(new BigDecimal("7.0"), new BigDecimal("8.0"));
// comparison is performed without scale consideration:
assertThat(new BigDecimal("8.0")).isBetween(new BigDecimal("8.0"), new BigDecimal("8.00"));

// assertion will fail
assertThat(new BigDecimal("8.0")).isBetween(new BigDecimal("6.0"), new BigDecimal("7.0"));
Note that comparison of BigDecimal is done by value without scale consideration, i.e 2.0 and 2.00 are considered equal in value unlike BigDecimal#equals(Object).
Parameters
start:BigDecimal

Doc from org.assertj.core.api.NumberAssert.isBetween.

the start value (inclusive), expected not to be null.

end:BigDecimal

Doc from org.assertj.core.api.NumberAssert.isBetween.

the end value (inclusive), expected not to be null.

Returns:SELF

Doc from org.assertj.core.api.NumberAssert.isBetween.

this assertion object.

Annotations
@Override
isCloseToback to summary
public SELF isCloseTo(final BigDecimal expected, final Offset<BigDecimal> offset)

Implements org.assertj.core.api.NumberAssert.isCloseTo.

Verifies that the actual number is close to the given one within the given offset value.

When abs(actual - expected) == offset value, the assertion:

Breaking change since 2.9.0/3.9.0: using Assertions#byLessThan(BigDecimal) implies a strict comparison, use Assertions#within(BigDecimal) to get the old behavior.

Examples:

 final BigDecimal eightDotOne = new BigDecimal("8.1");
final BigDecimal eight =  new BigDecimal("8.0");

// assertions succeed
assertThat(eightDotOne).isCloseTo(eight, within(new BigDecimal("0.2")));
assertThat(eightDotOne).isCloseTo(eight, byLessThan(new BigDecimal("0.2"))); // strict

// assertions succeed when the difference == offset value ...
assertThat(eightDotOne).isCloseTo(eight, within(new BigDecimal("0.1")));
// ... except when using byLessThan which implies a strict comparison
assertThat(eightDotOne).isCloseTo(eight, byLessThan(new BigDecimal("0.1"))); // strict => fail

// this assertion also fails
assertThat(eightDotOne).isCloseTo(eight, within(new BigDecimal("0.001")));
Parameters
expected:BigDecimal

the given number to compare the actual value to.

offset:Offset<BigDecimal>

the given positive offset.

Returns:SELF

this assertion object.

Annotations
@Override
Exceptions
NullPointerException:
  • if the given offset is null.
  • if the expected number is null.
AssertionError:
if the actual value is not close to the given one.
isCloseToback to summary
public SELF isCloseTo(BigDecimal expected, Percentage percentage)

Implements org.assertj.core.api.NumberAssert.isCloseTo.

Verifies that the actual number is close to the given one within the given percentage.
If difference is equal to the percentage value, assertion is considered valid.

Example with BigDecimal:

 // assertions will pass:
assertThat(BigDecimal.valueOf(11.0)).isCloseTo(BigDecimal.TEN, withinPercentage(BigDecimal.valueOf(20d)));

// if difference is exactly equals to the computed offset (1.0), it's ok
assertThat(BigDecimal.valueOf(11.0)).isCloseTo(BigDecimal.TEN, withinPercentage(BigDecimal.valueOf(10d)));

// assertion will fail
assertThat(BigDecimal.valueOf(11.0)).isCloseTo(BigDecimal.TEN, withinPercentage(BigDecimal.valueOf(5d)));
Parameters
expected:BigDecimal

the given number to compare the actual value to.

percentage:Percentage

the given positive percentage.

Returns:SELF

this assertion object.

Annotations
@Override
Exceptions
NullPointerException:
  • if the given offset is null.
  • if the expected number is null.
AssertionError:
if the actual value is not close to the given one.
isEqualByComparingToback to summary
public SELF isEqualByComparingTo(String expected)

Overrides org.assertj.core.api.AbstractComparableAssert.isEqualByComparingTo.

Implements org.assertj.core.api.ComparableAssert.isEqualByComparingTo.

Same as isEqualByComparingTo(BigDecimal) but takes care of converting given String to BigDecimal.

Example:

 // assertions will pass
assertThat(new BigDecimal("8.0")).isEqualByComparingTo("8.0");
// assertion will pass because 8.0 is equals to 8.00 using BigDecimal#compareTo(Object)
assertThat(new BigDecimal("8.0")).isEqualByComparingTo("8.00");

// assertion will fail
assertThat(new BigDecimal("8.0")).isEqualByComparingTo("2.0");
Parameters
expected:String

the expected BigDecimal passed as a String

Returns:SELF

this assertion object.

isEqualToback to summary
public SELF isEqualTo(String expected)

Same as isEqualTo(BigDecimal) but takes care of converting given String to BigDecimal for you.

Example:

 // assertion will pass
assertThat(new BigDecimal("8.0")).isEqualTo("8.0");

// assertion will fail because 8.00 is not equals to 8.0
assertThat(new BigDecimal("8.00")).isEqualTo("8.0");
Parameters
expected:String

the given number to compare the actual value to.

Returns:SELF

this assertion object.

isGreaterThanOrEqualToback to summary
public SELF isGreaterThanOrEqualTo(BigDecimal other)

Overrides org.assertj.core.api.AbstractComparableAssert.isGreaterThanOrEqualTo.

Implements org.assertj.core.api.ComparableAssert.isGreaterThanOrEqualTo.

Verifies that the actual value is greater than or equal to the given one.

Example:

 // assertions will pass
assertThat(BigDecimal.ONE).isGreaterThanOrEqualTo(BigDecimal.ZERO);
assertThat(BigDecimal.ONE).isGreaterThanOrEqualTo(BigDecimal.ONE);
// comparison is performed without scale consideration:
assertThat(BigDecimal.ONE).isGreaterThanOrEqualTo(new BigDecimal("1.00"));

// assertions will fail
assertThat(BigDecimal.ZERO).isGreaterThanOrEqualTo(BigDecimal.ONE);
Note that comparison of BigDecimal is done by value without scale consideration, i.e 2.0 and 2.00 are considered equal in value unlike BigDecimal#equals(Object).
Parameters
other:BigDecimal

the given value to compare the actual value to.

Returns:SELF

this assertion object.

Annotations
@Override
Exceptions
AssertionError:
  • if the actual value is null.
  • if the actual value is less than the given one.
isLessThanOrEqualToback to summary
public SELF isLessThanOrEqualTo(BigDecimal other)

Overrides org.assertj.core.api.AbstractComparableAssert.isLessThanOrEqualTo.

Implements org.assertj.core.api.ComparableAssert.isLessThanOrEqualTo.

Verifies that the actual value is less than or equal to the given one.

Example:

 // assertions will pass
assertThat(BigDecimal.ONE).isLessThanOrEqualTo(BigDecimal.TEN);
assertThat(BigDecimal.ONE).isLessThanOrEqualTo(BigDecimal.ONE);
// comparison is performed without scale consideration:
assertThat(BigDecimal.ONE).isLessThanOrEqualTo(new BigDecimal("1.00"));

// assertions will fail
assertThat(BigDecimal.ONE).isLessThanOrEqualTo(BigDecimal.ZERO);
Note that comparison of BigDecimal is done by value without scale consideration, i.e 2.0 and 2.00 are considered equal in value unlike BigDecimal#equals(Object).
Parameters
other:BigDecimal

the given value to compare the actual value to.

Returns:SELF

this assertion object.

Annotations
@Override
Exceptions
AssertionError:
  • if the actual value is null.
  • if the actual value is greater than the given one.
isNegativeback to summary
public SELF isNegative()

Implements org.assertj.core.api.NumberAssert.isNegative.

Doc from org.assertj.core.api.NumberAssert.isNegative.

Verifies that the actual value is negative.

Example:

 // assertions will pass
assertThat(-42).isNegative();
assertThat(-3.124).isNegative();

// assertions will fail
assertThat(0).isNegative();
assertThat(42).isNegative();

Example:

 // assertion will pass
assertThat(new BigDecimal("-8.0")).isNegative();

// assertion will fail
assertThat(new BigDecimal("8.0")).isNegative();
Returns:SELF

this assertion object.

Annotations
@Override
isNotCloseToback to summary
public SELF isNotCloseTo(final BigDecimal expected, final Offset<BigDecimal> offset)

Implements org.assertj.core.api.NumberAssert.isNotCloseTo.

Verifies that the actual number is not close to the given one by less than the given offset.

When abs(actual - expected) == offset value, the assertion:

Breaking change since 2.9.0/3.9.0: using Assertions#byLessThan(BigDecimal) implies a strict comparison, use Assertions#within(BigDecimal) to get the old behavior.

Example:

 final BigDecimal eightDotOne = new BigDecimal("8.1");
final BigDecimal eight =  new BigDecimal("8.0");

// assertions succeed
assertThat(eightDotOne).isNotCloseTo(eight, byLessThan(new BigDecimal("0.01")));
assertThat(eightDotOne).isNotCloseTo(eight, within(new BigDecimal("0.01")));
// diff == offset but isNotCloseTo succeeds as we use byLessThan
assertThat(eightDotOne).isNotCloseTo(eight, byLessThan(new BigDecimal("0.1")));

// assertions fail
assertThat(eightDotOne).isNotCloseTo(eight, within(new BigDecimal("0.1")));
assertThat(eightDotOne).isNotCloseTo(eight, within(new BigDecimal("0.2")));
assertThat(eightDotOne).isNotCloseTo(eight, byLessThan(new BigDecimal("0.2")));
Parameters
expected:BigDecimal

the given number to compare the actual value to.

offset:Offset<BigDecimal>

the given positive offset.

Returns:SELF

this assertion object.

Annotations
@Override
Exceptions
NullPointerException:
  • if the given offset is null.
  • if the expected number is null.
AssertionError:
if the actual value is close to the given one.
Since
2.6.0 / 3.6.0
See Also
Assertions#byLessThan(BigDecimal)
isNotCloseToback to summary
public SELF isNotCloseTo(BigDecimal expected, Percentage percentage)

Implements org.assertj.core.api.NumberAssert.isNotCloseTo.

Verifies that the actual number is not close to the given one by the given percentage.
If difference is equal to the percentage value, the assertion fails.

Example with BigDecimal:

 BigDecimal eleven = BigDecimal.valueOf(11.0);

// assertion will pass:
assertThat(eleven).isNotCloseTo(BigDecimal.TEN, withinPercentage(new BigDecimal("5")));

// assertion will fail as the difference is exactly equals to the computed offset (1.0)
assertThat(eleven).isNotCloseTo(BigDecimal.TEN, withinPercentage(new BigDecimal("10")));

// assertion will fail
assertThat(eleven).isNotCloseTo(BigDecimal.TEN, withinPercentage(new BigDecimal("20")));
Parameters
expected:BigDecimal

the given number to compare the actual value to.

percentage:Percentage

the given positive percentage.

Returns:SELF

this assertion object.

Annotations
@Override
Exceptions
NullPointerException:
  • if the given offset is null.
  • if the expected number is null.
AssertionError:
if the actual value is close to the given one.
isNotEqualByComparingToback to summary
public SELF isNotEqualByComparingTo(String notExpected)

Overrides org.assertj.core.api.AbstractComparableAssert.isNotEqualByComparingTo.

Implements org.assertj.core.api.ComparableAssert.isNotEqualByComparingTo.

Same as isNotEqualByComparingTo(BigDecimal) but takes care of converting given String to BigDecimal.

Example:

 // assertions will pass
assertThat(new BigDecimal("8.0")).isNotEqualByComparingTo("7.99");

// assertion will fail
assertThat(new BigDecimal("8.0")).isNotEqualByComparingTo("8.00");
Parameters
notExpected:String

the BigDecimal value passed as a String not to expect.

Returns:SELF

this assertion object.

isNotNegativeback to summary
public SELF isNotNegative()

Implements org.assertj.core.api.NumberAssert.isNotNegative.

Doc from org.assertj.core.api.NumberAssert.isNotNegative.

Verifies that the actual value is non negative (positive or equal zero).

Example:

 // assertions will pass
assertThat(42).isNotNegative();
assertThat(0).isNotNegative();

// assertions will fail
assertThat(-42).isNotNegative();
assertThat(-3.124).isNotNegative();

Example:

 // assertion will pass
assertThat(new BigDecimal("8.0")).isNotNegative();

// assertion will fail
assertThat(new BigDecimal("-8.0")).isNotNegative();
Returns:SELF

this assertion object.

Annotations
@Override
isNotPositiveback to summary
public SELF isNotPositive()

Implements org.assertj.core.api.NumberAssert.isNotPositive.

Doc from org.assertj.core.api.NumberAssert.isNotPositive.

Verifies that the actual value is non positive (negative or equal zero).

Example:

 // assertions will pass
assertThat(-42).isNotPositive();
assertThat(0).isNotPositive();

// assertions will fail
assertThat(42).isNotPositive();
assertThat(3.124).isNotPositive();

Example:

 // assertion will pass
assertThat(new BigDecimal("-8.0")).isNotPositive();

// assertion will fail
assertThat(new BigDecimal("8.0")).isNotPositive();
Returns:SELF

this assertion object.

Annotations
@Override
isNotZeroback to summary
public SELF isNotZero()

Implements org.assertj.core.api.NumberAssert.isNotZero.

Doc from org.assertj.core.api.NumberAssert.isNotZero.

Verifies that the actual value is not equal to zero.

Example:

 // assertions will pass
assertThat(42).isNotZero();
assertThat(3.142).isNotZero();

// assertions will fail
assertThat(0).isNotZero();
assertThat(0.0).isNotZero();

Example:

 // assertion will pass
assertThat(new BigDecimal("8.00")).isNotZero();

// assertion will fail
assertThat(BigDecimal.ZERO).isNotZero();
Returns:SELF

this assertion object.

Annotations
@Override
isOneback to summary
public SELF isOne()

Implements org.assertj.core.api.NumberAssert.isOne.

Doc from org.assertj.core.api.NumberAssert.isOne.

Verifies that the actual value is equal to one.

Example:

 // assertions will pass
assertThat(1).isOne();
assertThat(1.0).isOne();

// assertions will fail
assertThat(42).isOne();
assertThat(3.142).isOne();

Example:

 // assertion will pass
assertThat(BigDecimal.ONE).isOne();

// assertion will fail
assertThat(new BigDecimal("8.00")).isOne();
Returns:SELF

this assertion object.

Annotations
@Override
isPositiveback to summary
public SELF isPositive()

Implements org.assertj.core.api.NumberAssert.isPositive.

Doc from org.assertj.core.api.NumberAssert.isPositive.

Verifies that the actual value is positive.

Example:

 // assertions will pass
assertThat(42).isPositive();
assertThat(3.142).isPositive();

// assertions will fail
assertThat(0).isPositive();
assertThat(-42).isPositive();

Example:

 // assertion will pass
assertThat(new BigDecimal("8.0")).isPositive();

// assertion will fail
assertThat(new BigDecimal("-8.0")).isPositive();
Returns:SELF

this assertion object.

Annotations
@Override
isStrictlyBetweenback to summary
public SELF isStrictlyBetween(BigDecimal start, BigDecimal end)

Overrides org.assertj.core.api.AbstractComparableAssert.isStrictlyBetween.

Implements org.assertj.core.api.NumberAssert.isStrictlyBetween, org.assertj.core.api.ComparableAssert.isStrictlyBetween.

Verifies that the actual value is in ]start, end[ range (start excluded, end excluded).

Example:

 // assertion will pass
assertThat(new BigDecimal("8.0")).isStrictlyBetween(new BigDecimal("7.0"), new BigDecimal("9.0"));

// assertions will fail
assertThat(new BigDecimal("8.0")).isStrictlyBetween(new BigDecimal("8.0"), new BigDecimal("9.0"));
assertThat(new BigDecimal("8.0")).isStrictlyBetween(new BigDecimal("7.0"), new BigDecimal("8.0"));
Parameters
start:BigDecimal

Doc from org.assertj.core.api.NumberAssert.isStrictlyBetween.

the start value (exclusive), expected not to be null.

end:BigDecimal

Doc from org.assertj.core.api.NumberAssert.isStrictlyBetween.

the end value (exclusive), expected not to be null.

Returns:SELF

Doc from org.assertj.core.api.NumberAssert.isStrictlyBetween.

this assertion object.

Annotations
@Override
isZeroback to summary
public SELF isZero()

Implements org.assertj.core.api.NumberAssert.isZero.

Doc from org.assertj.core.api.NumberAssert.isZero.

Verifies that the actual value is equal to zero.

Example:

 // assertions will pass
assertThat(0).isZero();
assertThat(0.0).isZero();

// assertions will fail
assertThat(42).isZero();
assertThat(3.142).isZero();

Example:

 // assertion will pass
assertThat(BigDecimal.ZERO).isZero();

// assertion will fail
assertThat(new BigDecimal("8.00")).isZero();
Returns:SELF

this assertion object.

Annotations
@Override
scaleback to summary
public AbstractBigDecimalScaleAssert<SELF> scale()

Returns an Assert object that allows performing assertions on the scale of the BigDecimal under test.

Once this method is called, the object under test is no longer the BigDecimal but its scale. To perform assertions on the BigDecimal, call AbstractBigDecimalScaleAssert#returnToBigDecimal().

Example:

 BigDecimal bgDecimal = new BigDecimal("9.3231");

// assertions succeed
assertThat(bgDecimal).scale().isGreaterThan(1)
                             .isLessThan(5)
                     .returnToBigDecimal().isPositive();
assertThat(bgDecimal.setScale(5)).scale().isLessThan(6);

// assertions fails
assertThat(bgDecimal).scale().isBetween(5, 8);
assertThat(bgDecimal.setScale(5)).scale().isLessThan(5);
Returns:AbstractBigDecimalScaleAssert<SELF>

AbstractBigDecimalScaleAssert built with the BigDecimal's scale.

Annotations
@SuppressWarnings:unchecked, rawtypes
Exceptions
NullPointerException:
if the given BigDecimal is null.
usingComparatorback to summary
public SELF usingComparator(Comparator<? super BigDecimal> customComparator)

Overrides org.assertj.core.api.AbstractComparableAssert.usingComparator.

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

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

Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks.

The custom comparator is bound to assertion instance, meaning that if a new assertion instance is created, the default comparison strategy will be used.

Examples :

 // frodo and sam are instances of Character with Hobbit race (obviously :).
// raceComparator implements Comparator<Character>
assertThat(frodo).usingComparator(raceComparator).isEqualTo(sam);
Parameters
customComparator:Comparator<? super BigDecimal>

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
@CheckReturnValue
usingComparatorback to summary
public SELF usingComparator(Comparator<? super BigDecimal> customComparator, String customComparatorDescription)

Overrides org.assertj.core.api.AbstractComparableAssert.usingComparator.

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

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

Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks.

The custom comparator is bound to assertion instance, meaning that if a new assertion instance is created, the default comparison strategy will be used.

Examples :

 // frodo and sam are instances of Character with Hobbit race (obviously :).
// raceComparator implements Comparator<Character>
assertThat(frodo).usingComparator(raceComparator, "Hobbit Race Comparator").isEqualTo(sam);
Parameters
customComparator:Comparator<? super BigDecimal>

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
@CheckReturnValue
usingDefaultComparatorback to summary
public SELF usingDefaultComparator()

Overrides org.assertj.core.api.AbstractComparableAssert.usingDefaultComparator.

Implements org.assertj.core.api.Assert.usingDefaultComparator.

Doc from org.assertj.core.api.AbstractAssert.usingDefaultComparator.

Revert to standard comparison for the incoming assertion checks.

This method should be used to disable a custom comparison strategy set by calling usingComparator.

Returns:SELF

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

this assertion object.

Annotations
@Override
@CheckReturnValue