
com.foursoft.vecmodel.vec120.AbstractVecItemEquivalenceAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vec120-assertions Show documentation
Show all versions of vec120-assertions Show documentation
The Assertions Library for VEC version 1.2.0.
package com.foursoft.vecmodel.vec120;
import org.assertj.core.internal.Iterables;
import org.assertj.core.util.Objects;
/**
* Abstract base class for {@link VecItemEquivalence} specific assertions - Generated by CustomAssertionGenerator.
*/
@javax.annotation.Generated(value="assertj-assertions-generator")
public abstract class AbstractVecItemEquivalenceAssert, A extends VecItemEquivalence> extends AbstractVecExtendableElementAssert {
/**
* Creates a new {@link AbstractVecItemEquivalenceAssert}
to make assertions on actual VecItemEquivalence.
* @param actual the VecItemEquivalence we want to make assertions on.
*/
protected AbstractVecItemEquivalenceAssert(A actual, Class selfType) {
super(actual, selfType);
}
/**
* Verifies that the actual VecItemEquivalence's companyName is equal to the given one.
* @param companyName the given companyName to compare the actual VecItemEquivalence's companyName to.
* @return this assertion object.
* @throws AssertionError - if the actual VecItemEquivalence's companyName is not equal to the given one.
*/
public S hasCompanyName(String companyName) {
// check that actual VecItemEquivalence we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting companyName of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualCompanyName = actual.getCompanyName();
if (!Objects.areEqual(actualCompanyName, companyName)) {
failWithMessage(assertjErrorMessage, actual, companyName, actualCompanyName);
}
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecItemEquivalence's item contains the given VecItemVersion elements.
* @param item the given elements that should be contained in actual VecItemEquivalence's item.
* @return this assertion object.
* @throws AssertionError if the actual VecItemEquivalence's item does not contain all given VecItemVersion elements.
*/
public S hasItem(VecItemVersion... item) {
// check that actual VecItemEquivalence we want to make assertions on is not null.
isNotNull();
// check that given VecItemVersion varargs is not null.
if (item == null) failWithMessage("Expecting item 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.getItem(), item);
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecItemEquivalence's item contains the given VecItemVersion elements in Collection.
* @param item the given elements that should be contained in actual VecItemEquivalence's item.
* @return this assertion object.
* @throws AssertionError if the actual VecItemEquivalence's item does not contain all given VecItemVersion elements.
*/
public S hasItem(java.util.Collection extends VecItemVersion> item) {
// check that actual VecItemEquivalence we want to make assertions on is not null.
isNotNull();
// check that given VecItemVersion collection is not null.
if (item == null) {
failWithMessage("Expecting item 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.getItem(), item.toArray());
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecItemEquivalence's item contains only the given VecItemVersion elements and nothing else in whatever order.
* @param item the given elements that should be contained in actual VecItemEquivalence's item.
* @return this assertion object.
* @throws AssertionError if the actual VecItemEquivalence's item does not contain all given VecItemVersion elements.
*/
public S hasOnlyItem(VecItemVersion... item) {
// check that actual VecItemEquivalence we want to make assertions on is not null.
isNotNull();
// check that given VecItemVersion varargs is not null.
if (item == null) failWithMessage("Expecting item 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.getItem(), item);
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecItemEquivalence's item contains only the given VecItemVersion elements in Collection and nothing else in whatever order.
* @param item the given elements that should be contained in actual VecItemEquivalence's item.
* @return this assertion object.
* @throws AssertionError if the actual VecItemEquivalence's item does not contain all given VecItemVersion elements.
*/
public S hasOnlyItem(java.util.Collection extends VecItemVersion> item) {
// check that actual VecItemEquivalence we want to make assertions on is not null.
isNotNull();
// check that given VecItemVersion collection is not null.
if (item == null) {
failWithMessage("Expecting item 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.getItem(), item.toArray());
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecItemEquivalence's item does not contain the given VecItemVersion elements.
*
* @param item the given elements that should not be in actual VecItemEquivalence's item.
* @return this assertion object.
* @throws AssertionError if the actual VecItemEquivalence's item contains any given VecItemVersion elements.
*/
public S doesNotHaveItem(VecItemVersion... item) {
// check that actual VecItemEquivalence we want to make assertions on is not null.
isNotNull();
// check that given VecItemVersion varargs is not null.
if (item == null) failWithMessage("Expecting item parameter not to be null.");
// check with standard error message (use overridingErrorMessage before contains to set your own message).
Iterables.instance().assertDoesNotContain(info, actual.getItem(), item);
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecItemEquivalence's item does not contain the given VecItemVersion elements in Collection.
*
* @param item the given elements that should not be in actual VecItemEquivalence's item.
* @return this assertion object.
* @throws AssertionError if the actual VecItemEquivalence's item contains any given VecItemVersion elements.
*/
public S doesNotHaveItem(java.util.Collection extends VecItemVersion> item) {
// check that actual VecItemEquivalence we want to make assertions on is not null.
isNotNull();
// check that given VecItemVersion collection is not null.
if (item == null) {
failWithMessage("Expecting item 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.getItem(), item.toArray());
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecItemEquivalence has no item.
* @return this assertion object.
* @throws AssertionError if the actual VecItemEquivalence's item is not empty.
*/
public S hasNoItem() {
// check that actual VecItemEquivalence 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 item but had :\n <%s>";
// check
if (actual.getItem().iterator().hasNext()) {
failWithMessage(assertjErrorMessage, actual, actual.getItem());
}
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecItemEquivalence's parentDocumentVersion is equal to the given one.
* @param parentDocumentVersion the given parentDocumentVersion to compare the actual VecItemEquivalence's parentDocumentVersion to.
* @return this assertion object.
* @throws AssertionError - if the actual VecItemEquivalence's parentDocumentVersion is not equal to the given one.
*/
public S hasParentDocumentVersion(VecDocumentVersion parentDocumentVersion) {
// check that actual VecItemEquivalence we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting parentDocumentVersion of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
VecDocumentVersion actualParentDocumentVersion = actual.getParentDocumentVersion();
if (!Objects.areEqual(actualParentDocumentVersion, parentDocumentVersion)) {
failWithMessage(assertjErrorMessage, actual, parentDocumentVersion, actualParentDocumentVersion);
}
// return the current assertion for method chaining
return myself;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy