/**
   * Verifies that the actual ApplicationNode's version is equal to the given one.
   *
   * @param version the given version to compare the actual ApplicationNode's version to.
   * @return this assertion object.
   * @throws AssertionError - if the actual ApplicationNode's version is not equal to the given one.
   */
  public ApplicationNodeAssert hasVersion(String version) {
    // check that actual ApplicationNode we want to make assertions on is not null.
    isNotNull();

    // overrides the default error message with a more explicit one
    String assertjErrorMessage = "\nExpected version of:\n  <%s>\nto be:\n  <%s>\nbut was:\n  <%s>";

    // null safe check
    String actualVersion = actual.getVersion();
    if (!Objects.areEqual(actualVersion, version)) {
      failWithMessage(assertjErrorMessage, actual, version, actualVersion);
    }

    // return the current assertion for method chaining
    return this;
  }
  /**
   * Verifies that the actual MarketConnexionDescriptor's host is equal to the given one.
   *
   * @param host the given host to compare the actual MarketConnexionDescriptor's host to.
   * @return this assertion object.
   * @throws AssertionError - if the actual MarketConnexionDescriptor's host is not equal to the
   *     given one.
   */
  public MarketConnexionDescriptorAssert hasHost(String host) {
    // check that actual MarketConnexionDescriptor we want to make assertions on is not null.
    isNotNull();

    // overrides the default error message with a more explicit one
    String assertjErrorMessage = "\nExpected host of:\n  <%s>\nto be:\n  <%s>\nbut was:\n  <%s>";

    // null safe check
    String actualHost = actual.getHost();
    if (!org.assertj.core.util.Objects.areEqual(actualHost, host)) {
      failWithMessage(assertjErrorMessage, actual, host, actualHost);
    }

    // return the current assertion for method chaining
    return this;
  }
Exemple #3
0
 private void assertNotNull(AssertionInfo info, Map<?, ?> actual) {
   Objects.instance().assertNotNull(info, actual);
 }