templates.is_wrapper_assertion_template.txt Maven / Gradle / Ivy
The newest version!
/**
* Verifies that the actual ${class_to_assert} ${predicate_for_javadoc}.
* @return this assertion object.
* @throws AssertionError - if the actual ${class_to_assert} ${negative_predicate_for_javadoc}.${throws_javadoc}
*/
public ${self_type} ${predicate}() ${throws}{
// check that actual ${class_to_assert} we want to make assertions on is not null.
isNotNull();
// null safe check
if (Objects.deepEquals(Boolean.FALSE, actual.${predicate}())) {
failWithMessage("\nExpecting that actual ${class_to_assert} ${predicate_for_error_message_part1} but ${predicate_for_error_message_part2}.");
}
// return the current assertion for method chaining
return ${myself};
}
/**
* Verifies that the actual ${class_to_assert} ${negative_predicate_for_javadoc}.
* @return this assertion object.
* @throws AssertionError - if the actual ${class_to_assert} ${predicate_for_javadoc}.${throws_javadoc}
*/
public ${self_type} ${neg_predicate}() ${throws}{
// check that actual ${class_to_assert} we want to make assertions on is not null.
isNotNull();
// null safe check
if (Objects.deepEquals(Boolean.TRUE, actual.${predicate}())) {
failWithMessage("\nExpecting that actual ${class_to_assert} ${negative_predicate_for_error_message_part1} but ${negative_predicate_for_error_message_part2}.");
}
// return the current assertion for method chaining
return ${myself};
}