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

public Class LongPredicateAssert

extends AbstractPredicateLikeAssert<LongPredicateAssert, LongPredicate, Long>
Class Inheritance
Imports
java.util.function.LongPredicate, .Predicate, java.util.stream.Collectors, .LongStream

Assertions for LongPredicate.
Author
Filip Hrisafov
Since
3.5.0

Field Summary

Inherited from org.assertj.core.api.AbstractPredicateLikeAssert:
iterablesprimitivePredicate

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public LongPredicateAssert

Returns:

this assertion object.
accepts
(long...
values that the actual Predicate should accept.
values
)

Verifies that LongPredicate evaluates all the given values to true.

public static LongPredicateAssert
public LongPredicateAssert

Returns:

this assertion object.
rejects
(long...
values that the actual Predicate should reject.
values
)

Verifies that LongPredicate evaluates all the given values to false.

private static Predicate<Long>
Inherited from org.assertj.core.api.AbstractPredicateLikeAssert:
acceptsAllInternalacceptsInternalrejectsAllInternalrejectsInternal

Constructor Detail

LongPredicateAssertback to summary
public LongPredicateAssert(LongPredicate actual)

Method Detail

acceptsback to summary
public LongPredicateAssert accepts(long... values)

Verifies that LongPredicate evaluates all the given values to true.

Example :

 LongPredicate evenNumber = n -> n % 2 == 0;

// assertion succeeds:
assertThat(evenNumber).accepts(2, 4, 6);

// assertion fails because of 3:
assertThat(evenNumber).accepts(2, 3, 4);
Parameters
values:long[]

values that the actual Predicate should accept.

Returns:LongPredicateAssert

this assertion object.

Exceptions
AssertionError:
if the actual Predicate does not accept all given values.
assertThatLongPredicateback to summary
public static LongPredicateAssert assertThatLongPredicate(LongPredicate actual)
rejectsback to summary
public LongPredicateAssert rejects(long... values)

Verifies that LongPredicate evaluates all the given values to false.

Example :

 LongPredicate evenNumber = n -> n % 2 == 0;

// assertion succeeds:
assertThat(evenNumber).rejects(1, 3, 5);

// assertion fails because of 2:
assertThat(evenNumber).rejects(1, 2, 3);
Parameters
values:long[]

values that the actual Predicate should reject.

Returns:LongPredicateAssert

this assertion object.

Exceptions
AssertionError:
if the actual Predicate accepts one of the given values.
toPredicateback to summary
private static Predicate<Long> toPredicate(LongPredicate actual)