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

com.foursoft.vecmodel.vec120.AbstractVecExternalMappingSpecificationAssert Maven / Gradle / Ivy

There is a newer version: 1.5.2
Show newest version
package com.foursoft.vecmodel.vec120;

import org.assertj.core.internal.Iterables;
import org.assertj.core.util.Objects;

/**
 * Abstract base class for {@link VecExternalMappingSpecification} specific assertions - Generated by CustomAssertionGenerator.
 */
@javax.annotation.Generated(value="assertj-assertions-generator")
public abstract class AbstractVecExternalMappingSpecificationAssert, A extends VecExternalMappingSpecification> extends AbstractVecSpecificationAssert {

  /**
   * Creates a new {@link AbstractVecExternalMappingSpecificationAssert} to make assertions on actual VecExternalMappingSpecification.
   * @param actual the VecExternalMappingSpecification we want to make assertions on.
   */
  protected AbstractVecExternalMappingSpecificationAssert(A actual, Class selfType) {
    super(actual, selfType);
  }

  /**
   * Verifies that the actual VecExternalMappingSpecification's mappedDocument is equal to the given one.
   * @param mappedDocument the given mappedDocument to compare the actual VecExternalMappingSpecification's mappedDocument to.
   * @return this assertion object.
   * @throws AssertionError - if the actual VecExternalMappingSpecification's mappedDocument is not equal to the given one.
   */
  public S hasMappedDocument(VecDocumentVersion mappedDocument) {
    // check that actual VecExternalMappingSpecification we want to make assertions on is not null.
    isNotNull();

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

    // null safe check
    VecDocumentVersion actualMappedDocument = actual.getMappedDocument();
    if (!Objects.areEqual(actualMappedDocument, mappedDocument)) {
      failWithMessage(assertjErrorMessage, actual, mappedDocument, actualMappedDocument);
    }

    // return the current assertion for method chaining
    return myself;
  }

  /**
   * Verifies that the actual VecExternalMappingSpecification's mappings contains the given VecExternalMapping elements.
   * @param mappings the given elements that should be contained in actual VecExternalMappingSpecification's mappings.
   * @return this assertion object.
   * @throws AssertionError if the actual VecExternalMappingSpecification's mappings does not contain all given VecExternalMapping elements.
   */
  public S hasMappings(VecExternalMapping... mappings) {
    // check that actual VecExternalMappingSpecification we want to make assertions on is not null.
    isNotNull();

    // check that given VecExternalMapping varargs is not null.
    if (mappings == null) failWithMessage("Expecting mappings parameter not to be null.");

    // check with standard error message, to set another message call: info.overridingErrorMessage("my error message");
    Iterables.instance().assertContains(info, actual.getMappings(), mappings);

    // return the current assertion for method chaining
    return myself;
  }

  /**
   * Verifies that the actual VecExternalMappingSpecification's mappings contains the given VecExternalMapping elements in Collection.
   * @param mappings the given elements that should be contained in actual VecExternalMappingSpecification's mappings.
   * @return this assertion object.
   * @throws AssertionError if the actual VecExternalMappingSpecification's mappings does not contain all given VecExternalMapping elements.
   */
  public S hasMappings(java.util.Collection mappings) {
    // check that actual VecExternalMappingSpecification we want to make assertions on is not null.
    isNotNull();

    // check that given VecExternalMapping collection is not null.
    if (mappings == null) {
      failWithMessage("Expecting mappings parameter not to be null.");
      return myself; // to fool Eclipse "Null pointer access" warning on toArray.
    }

    // check with standard error message, to set another message call: info.overridingErrorMessage("my error message");
    Iterables.instance().assertContains(info, actual.getMappings(), mappings.toArray());

    // return the current assertion for method chaining
    return myself;
  }

  /**
   * Verifies that the actual VecExternalMappingSpecification's mappings contains only the given VecExternalMapping elements and nothing else in whatever order.
   * @param mappings the given elements that should be contained in actual VecExternalMappingSpecification's mappings.
   * @return this assertion object.
   * @throws AssertionError if the actual VecExternalMappingSpecification's mappings does not contain all given VecExternalMapping elements.
   */
  public S hasOnlyMappings(VecExternalMapping... mappings) {
    // check that actual VecExternalMappingSpecification we want to make assertions on is not null.
    isNotNull();

    // check that given VecExternalMapping varargs is not null.
    if (mappings == null) failWithMessage("Expecting mappings parameter not to be null.");

    // check with standard error message, to set another message call: info.overridingErrorMessage("my error message");
    Iterables.instance().assertContainsOnly(info, actual.getMappings(), mappings);

    // return the current assertion for method chaining
    return myself;
  }

  /**
   * Verifies that the actual VecExternalMappingSpecification's mappings contains only the given VecExternalMapping elements in Collection and nothing else in whatever order.
   * @param mappings the given elements that should be contained in actual VecExternalMappingSpecification's mappings.
   * @return this assertion object.
   * @throws AssertionError if the actual VecExternalMappingSpecification's mappings does not contain all given VecExternalMapping elements.
   */
  public S hasOnlyMappings(java.util.Collection mappings) {
    // check that actual VecExternalMappingSpecification we want to make assertions on is not null.
    isNotNull();

    // check that given VecExternalMapping collection is not null.
    if (mappings == null) {
      failWithMessage("Expecting mappings parameter not to be null.");
      return myself; // to fool Eclipse "Null pointer access" warning on toArray.
    }

    // check with standard error message, to set another message call: info.overridingErrorMessage("my error message");
    Iterables.instance().assertContainsOnly(info, actual.getMappings(), mappings.toArray());

    // return the current assertion for method chaining
    return myself;
  }

  /**
   * Verifies that the actual VecExternalMappingSpecification's mappings does not contain the given VecExternalMapping elements.
   *
   * @param mappings the given elements that should not be in actual VecExternalMappingSpecification's mappings.
   * @return this assertion object.
   * @throws AssertionError if the actual VecExternalMappingSpecification's mappings contains any given VecExternalMapping elements.
   */
  public S doesNotHaveMappings(VecExternalMapping... mappings) {
    // check that actual VecExternalMappingSpecification we want to make assertions on is not null.
    isNotNull();

    // check that given VecExternalMapping varargs is not null.
    if (mappings == null) failWithMessage("Expecting mappings parameter not to be null.");

    // check with standard error message (use overridingErrorMessage before contains to set your own message).
    Iterables.instance().assertDoesNotContain(info, actual.getMappings(), mappings);

    // return the current assertion for method chaining
    return myself;
  }

  /**
   * Verifies that the actual VecExternalMappingSpecification's mappings does not contain the given VecExternalMapping elements in Collection.
   *
   * @param mappings the given elements that should not be in actual VecExternalMappingSpecification's mappings.
   * @return this assertion object.
   * @throws AssertionError if the actual VecExternalMappingSpecification's mappings contains any given VecExternalMapping elements.
   */
  public S doesNotHaveMappings(java.util.Collection mappings) {
    // check that actual VecExternalMappingSpecification we want to make assertions on is not null.
    isNotNull();

    // check that given VecExternalMapping collection is not null.
    if (mappings == null) {
      failWithMessage("Expecting mappings parameter not to be null.");
      return myself; // to fool Eclipse "Null pointer access" warning on toArray.
    }

    // check with standard error message (use overridingErrorMessage before contains to set your own message).
    Iterables.instance().assertDoesNotContain(info, actual.getMappings(), mappings.toArray());

    // return the current assertion for method chaining
    return myself;
  }

  /**
   * Verifies that the actual VecExternalMappingSpecification has no mappings.
   * @return this assertion object.
   * @throws AssertionError if the actual VecExternalMappingSpecification's mappings is not empty.
   */
  public S hasNoMappings() {
    // check that actual VecExternalMappingSpecification we want to make assertions on is not null.
    isNotNull();

    // we override the default error message with a more explicit one
    String assertjErrorMessage = "\nExpecting :\n  <%s>\nnot to have mappings but had :\n  <%s>";

    // check
    if (actual.getMappings().iterator().hasNext()) {
      failWithMessage(assertjErrorMessage, actual, actual.getMappings());
    }

    // return the current assertion for method chaining
    return myself;
  }


}