
com.foursoft.vecmodel.vec120.AbstractVecBaselineSpecificationAssert 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 VecBaselineSpecification} specific assertions - Generated by CustomAssertionGenerator.
*/
@javax.annotation.Generated(value="assertj-assertions-generator")
public abstract class AbstractVecBaselineSpecificationAssert, A extends VecBaselineSpecification> extends AbstractVecSpecificationAssert {
/**
* Creates a new {@link AbstractVecBaselineSpecificationAssert}
to make assertions on actual VecBaselineSpecification.
* @param actual the VecBaselineSpecification we want to make assertions on.
*/
protected AbstractVecBaselineSpecificationAssert(A actual, Class selfType) {
super(actual, selfType);
}
/**
* Verifies that the actual VecBaselineSpecification's content is equal to the given one.
* @param content the given content to compare the actual VecBaselineSpecification's content to.
* @return this assertion object.
* @throws AssertionError - if the actual VecBaselineSpecification's content is not equal to the given one.
*/
public S hasContent(String content) {
// check that actual VecBaselineSpecification we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting content of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualContent = actual.getContent();
if (!Objects.areEqual(actualContent, content)) {
failWithMessage(assertjErrorMessage, actual, content, actualContent);
}
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecBaselineSpecification's state is equal to the given one.
* @param state the given state to compare the actual VecBaselineSpecification's state to.
* @return this assertion object.
* @throws AssertionError - if the actual VecBaselineSpecification's state is not equal to the given one.
*/
public S hasState(String state) {
// check that actual VecBaselineSpecification we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting state of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
String actualState = actual.getState();
if (!Objects.areEqual(actualState, state)) {
failWithMessage(assertjErrorMessage, actual, state, actualState);
}
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecBaselineSpecification's validVersions contains the given VecItemVersion elements.
* @param validVersions the given elements that should be contained in actual VecBaselineSpecification's validVersions.
* @return this assertion object.
* @throws AssertionError if the actual VecBaselineSpecification's validVersions does not contain all given VecItemVersion elements.
*/
public S hasValidVersions(VecItemVersion... validVersions) {
// check that actual VecBaselineSpecification we want to make assertions on is not null.
isNotNull();
// check that given VecItemVersion varargs is not null.
if (validVersions == null) failWithMessage("Expecting validVersions 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.getValidVersions(), validVersions);
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecBaselineSpecification's validVersions contains the given VecItemVersion elements in Collection.
* @param validVersions the given elements that should be contained in actual VecBaselineSpecification's validVersions.
* @return this assertion object.
* @throws AssertionError if the actual VecBaselineSpecification's validVersions does not contain all given VecItemVersion elements.
*/
public S hasValidVersions(java.util.Collection extends VecItemVersion> validVersions) {
// check that actual VecBaselineSpecification we want to make assertions on is not null.
isNotNull();
// check that given VecItemVersion collection is not null.
if (validVersions == null) {
failWithMessage("Expecting validVersions 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.getValidVersions(), validVersions.toArray());
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecBaselineSpecification's validVersions contains only the given VecItemVersion elements and nothing else in whatever order.
* @param validVersions the given elements that should be contained in actual VecBaselineSpecification's validVersions.
* @return this assertion object.
* @throws AssertionError if the actual VecBaselineSpecification's validVersions does not contain all given VecItemVersion elements.
*/
public S hasOnlyValidVersions(VecItemVersion... validVersions) {
// check that actual VecBaselineSpecification we want to make assertions on is not null.
isNotNull();
// check that given VecItemVersion varargs is not null.
if (validVersions == null) failWithMessage("Expecting validVersions 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.getValidVersions(), validVersions);
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecBaselineSpecification's validVersions contains only the given VecItemVersion elements in Collection and nothing else in whatever order.
* @param validVersions the given elements that should be contained in actual VecBaselineSpecification's validVersions.
* @return this assertion object.
* @throws AssertionError if the actual VecBaselineSpecification's validVersions does not contain all given VecItemVersion elements.
*/
public S hasOnlyValidVersions(java.util.Collection extends VecItemVersion> validVersions) {
// check that actual VecBaselineSpecification we want to make assertions on is not null.
isNotNull();
// check that given VecItemVersion collection is not null.
if (validVersions == null) {
failWithMessage("Expecting validVersions 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.getValidVersions(), validVersions.toArray());
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecBaselineSpecification's validVersions does not contain the given VecItemVersion elements.
*
* @param validVersions the given elements that should not be in actual VecBaselineSpecification's validVersions.
* @return this assertion object.
* @throws AssertionError if the actual VecBaselineSpecification's validVersions contains any given VecItemVersion elements.
*/
public S doesNotHaveValidVersions(VecItemVersion... validVersions) {
// check that actual VecBaselineSpecification we want to make assertions on is not null.
isNotNull();
// check that given VecItemVersion varargs is not null.
if (validVersions == null) failWithMessage("Expecting validVersions parameter not to be null.");
// check with standard error message (use overridingErrorMessage before contains to set your own message).
Iterables.instance().assertDoesNotContain(info, actual.getValidVersions(), validVersions);
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecBaselineSpecification's validVersions does not contain the given VecItemVersion elements in Collection.
*
* @param validVersions the given elements that should not be in actual VecBaselineSpecification's validVersions.
* @return this assertion object.
* @throws AssertionError if the actual VecBaselineSpecification's validVersions contains any given VecItemVersion elements.
*/
public S doesNotHaveValidVersions(java.util.Collection extends VecItemVersion> validVersions) {
// check that actual VecBaselineSpecification we want to make assertions on is not null.
isNotNull();
// check that given VecItemVersion collection is not null.
if (validVersions == null) {
failWithMessage("Expecting validVersions 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.getValidVersions(), validVersions.toArray());
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecBaselineSpecification has no validVersions.
* @return this assertion object.
* @throws AssertionError if the actual VecBaselineSpecification's validVersions is not empty.
*/
public S hasNoValidVersions() {
// check that actual VecBaselineSpecification 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 validVersions but had :\n <%s>";
// check
if (actual.getValidVersions().iterator().hasNext()) {
failWithMessage(assertjErrorMessage, actual, actual.getValidVersions());
}
// return the current assertion for method chaining
return myself;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy