io.fabric8.openshift.api.model.AbstractBuildSpecAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of assertions Show documentation
Show all versions of assertions Show documentation
A port of Kubernetes Assertions Library by Fabric8
package io.fabric8.openshift.api.model;
import org.assertj.core.api.AbstractAssert;
import org.assertj.core.api.Assertions;
import org.assertj.core.util.Objects;
import org.assertj.core.api.AssertFactory;
import com.stakater.kubernetes.assertions.NavigationListAssert;
import static org.assertj.core.api.Assertions.assertThat;
import static io.fabric8.kubernetes.assertions.internal.Assertions.assertThat;
/**
* Abstract base class for {@link BuildSpec} specific assertions - Generated by CustomAssertionGenerator.
*/
public abstract class AbstractBuildSpecAssert, A extends BuildSpec> extends AbstractAssert {
/**
* Creates a new {@link AbstractBuildSpecAssert}
to make assertions on actual BuildSpec.
* @param actual the BuildSpec we want to make assertions on.
*/
protected AbstractBuildSpecAssert(A actual, Class selfType) {
super(actual, selfType);
}
/**
* Navigates to the property additionalProperties so that assertions can be done on it
*/
public org.assertj.core.api.MapAssert additionalProperties() {
// check that actual BuildSpec we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (org.assertj.core.api.MapAssert) assertThat(actual.getAdditionalProperties()).describedAs(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "additionalProperties"));
}
/**
* Verifies that the actual BuildSpec's completionDeadlineSeconds is equal to the given one.
* @param completionDeadlineSeconds the given completionDeadlineSeconds to compare the actual BuildSpec's completionDeadlineSeconds to.
* @return this assertion object.
* @throws AssertionError - if the actual BuildSpec's completionDeadlineSeconds is not equal to the given one.
*/
public S hasCompletionDeadlineSeconds(Long completionDeadlineSeconds) {
// check that actual BuildSpec we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting completionDeadlineSeconds of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
Long actualCompletionDeadlineSeconds = actual.getCompletionDeadlineSeconds();
if (!Objects.areEqual(actualCompletionDeadlineSeconds, completionDeadlineSeconds)) {
failWithMessage(assertjErrorMessage, actual, completionDeadlineSeconds, actualCompletionDeadlineSeconds);
}
// return the current assertion for method chaining
return myself;
}
/**
* Navigates to the property nodeSelector so that assertions can be done on it
*/
public org.assertj.core.api.MapAssert nodeSelector() {
// check that actual BuildSpec we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (org.assertj.core.api.MapAssert) assertThat(actual.getNodeSelector()).describedAs(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "nodeSelector"));
}
/**
* Navigates to the property output so that assertions can be done on it
*/
public BuildOutputAssert output() {
// check that actual BuildSpec we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (BuildOutputAssert) assertThat(actual.getOutput()).describedAs(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "output"));
}
/**
* Navigates to the property postCommit so that assertions can be done on it
*/
public BuildPostCommitSpecAssert postCommit() {
// check that actual BuildSpec we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (BuildPostCommitSpecAssert) assertThat(actual.getPostCommit()).describedAs(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "postCommit"));
}
/**
* Navigates to the property resources so that assertions can be done on it
*/
public io.fabric8.kubernetes.api.model.ResourceRequirementsAssert resources() {
// check that actual BuildSpec we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (io.fabric8.kubernetes.api.model.ResourceRequirementsAssert) assertThat(actual.getResources()).describedAs(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "resources"));
}
/**
* Navigates to the property revision so that assertions can be done on it
*/
public SourceRevisionAssert revision() {
// check that actual BuildSpec we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (SourceRevisionAssert) assertThat(actual.getRevision()).describedAs(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "revision"));
}
/**
* Navigates to the property serviceAccount so that assertions can be done on it
*/
public org.assertj.core.api.StringAssert serviceAccount() {
// check that actual BuildSpec we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (org.assertj.core.api.StringAssert) assertThat(actual.getServiceAccount()).describedAs(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "serviceAccount"));
}
/**
* Navigates to the property source so that assertions can be done on it
*/
public BuildSourceAssert source() {
// check that actual BuildSpec we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (BuildSourceAssert) assertThat(actual.getSource()).describedAs(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "source"));
}
/**
* Navigates to the property strategy so that assertions can be done on it
*/
public BuildStrategyAssert strategy() {
// check that actual BuildSpec we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (BuildStrategyAssert) assertThat(actual.getStrategy()).describedAs(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "strategy"));
}
/**
* Navigates to the property triggeredBy so that assertions can be done on it
*/
public NavigationListAssert triggeredBy() {
isNotNull();
// return the assertion for the property
AssertFactory assertFactory = new AssertFactory() {
public BuildTriggerCauseAssert createAssert(BuildTriggerCause t) {
return (BuildTriggerCauseAssert) assertThat(t);
}
};
NavigationListAssert answer = new NavigationListAssert(actual.getTriggeredBy(), assertFactory);
answer.describedAs(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "triggeredBy"));
return answer;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy