All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.is_wrapper_assertion_template.txt Maven / Gradle / Ivy

There is a newer version: 2.2.1
Show 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.areEqual(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.areEqual(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};
  }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy