io.fabric8.kubernetes.api.model.AbstractEventAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kubernetes-assertions
Show all versions of kubernetes-assertions
This library provides a bunch of helpful assertj assertions for working with the kubernetes-api.
The newest version!
package io.fabric8.kubernetes.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 io.fabric8.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 Event} specific assertions - Generated by CustomAssertionGenerator.
*/
public abstract class AbstractEventAssert, A extends Event> extends AbstractAssert {
/**
* Creates a new {@link AbstractEventAssert}
to make assertions on actual Event.
* @param actual the Event we want to make assertions on.
*/
protected AbstractEventAssert(A actual, Class selfType) {
super(actual, selfType);
}
/**
* Navigates to the property action so that assertions can be done on it
*/
public org.assertj.core.api.StringAssert action() {
// check that actual Event we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (org.assertj.core.api.StringAssert) assertThat(actual.getAction()).describedAs(io.fabric8.kubernetes.assertions.Assertions.joinDescription(this, "action"));
}
/**
* Navigates to the property additionalProperties so that assertions can be done on it
*/
public org.assertj.core.api.MapAssert additionalProperties() {
// check that actual Event 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(io.fabric8.kubernetes.assertions.Assertions.joinDescription(this, "additionalProperties"));
}
/**
* Navigates to the property apiVersion so that assertions can be done on it
*/
public org.assertj.core.api.StringAssert apiVersion() {
// check that actual Event we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (org.assertj.core.api.StringAssert) assertThat(actual.getApiVersion()).describedAs(io.fabric8.kubernetes.assertions.Assertions.joinDescription(this, "apiVersion"));
}
/**
* Verifies that the actual Event's count is equal to the given one.
* @param count the given count to compare the actual Event's count to.
* @return this assertion object.
* @throws AssertionError - if the actual Event's count is not equal to the given one.
*/
public S hasCount(Integer count) {
// check that actual Event we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting count of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
Integer actualCount = actual.getCount();
if (!Objects.areEqual(actualCount, count)) {
failWithMessage(assertjErrorMessage, actual, count, actualCount);
}
// return the current assertion for method chaining
return myself;
}
/**
* Navigates to the property eventTime so that assertions can be done on it
*/
public MicroTimeAssert eventTime() {
// check that actual Event we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (MicroTimeAssert) assertThat(actual.getEventTime()).describedAs(io.fabric8.kubernetes.assertions.Assertions.joinDescription(this, "eventTime"));
}
/**
* Navigates to the property firstTimestamp so that assertions can be done on it
*/
public org.assertj.core.api.StringAssert firstTimestamp() {
// check that actual Event we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (org.assertj.core.api.StringAssert) assertThat(actual.getFirstTimestamp()).describedAs(io.fabric8.kubernetes.assertions.Assertions.joinDescription(this, "firstTimestamp"));
}
/**
* Navigates to the property involvedObject so that assertions can be done on it
*/
public ObjectReferenceAssert involvedObject() {
// check that actual Event we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (ObjectReferenceAssert) assertThat(actual.getInvolvedObject()).describedAs(io.fabric8.kubernetes.assertions.Assertions.joinDescription(this, "involvedObject"));
}
/**
* Navigates to the property kind so that assertions can be done on it
*/
public org.assertj.core.api.StringAssert kind() {
// check that actual Event we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (org.assertj.core.api.StringAssert) assertThat(actual.getKind()).describedAs(io.fabric8.kubernetes.assertions.Assertions.joinDescription(this, "kind"));
}
/**
* Navigates to the property lastTimestamp so that assertions can be done on it
*/
public org.assertj.core.api.StringAssert lastTimestamp() {
// check that actual Event we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (org.assertj.core.api.StringAssert) assertThat(actual.getLastTimestamp()).describedAs(io.fabric8.kubernetes.assertions.Assertions.joinDescription(this, "lastTimestamp"));
}
/**
* Navigates to the property message so that assertions can be done on it
*/
public org.assertj.core.api.StringAssert message() {
// check that actual Event we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (org.assertj.core.api.StringAssert) assertThat(actual.getMessage()).describedAs(io.fabric8.kubernetes.assertions.Assertions.joinDescription(this, "message"));
}
/**
* Navigates to the property metadata so that assertions can be done on it
*/
public ObjectMetaAssert metadata() {
// check that actual Event we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (ObjectMetaAssert) assertThat(actual.getMetadata()).describedAs(io.fabric8.kubernetes.assertions.Assertions.joinDescription(this, "metadata"));
}
/**
* Navigates to the property reason so that assertions can be done on it
*/
public org.assertj.core.api.StringAssert reason() {
// check that actual Event we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (org.assertj.core.api.StringAssert) assertThat(actual.getReason()).describedAs(io.fabric8.kubernetes.assertions.Assertions.joinDescription(this, "reason"));
}
/**
* Navigates to the property related so that assertions can be done on it
*/
public ObjectReferenceAssert related() {
// check that actual Event we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (ObjectReferenceAssert) assertThat(actual.getRelated()).describedAs(io.fabric8.kubernetes.assertions.Assertions.joinDescription(this, "related"));
}
/**
* Navigates to the property reportingComponent so that assertions can be done on it
*/
public org.assertj.core.api.StringAssert reportingComponent() {
// check that actual Event we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (org.assertj.core.api.StringAssert) assertThat(actual.getReportingComponent()).describedAs(io.fabric8.kubernetes.assertions.Assertions.joinDescription(this, "reportingComponent"));
}
/**
* Navigates to the property reportingInstance so that assertions can be done on it
*/
public org.assertj.core.api.StringAssert reportingInstance() {
// check that actual Event we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (org.assertj.core.api.StringAssert) assertThat(actual.getReportingInstance()).describedAs(io.fabric8.kubernetes.assertions.Assertions.joinDescription(this, "reportingInstance"));
}
/**
* Navigates to the property series so that assertions can be done on it
*/
public EventSeriesAssert series() {
// check that actual Event we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (EventSeriesAssert) assertThat(actual.getSeries()).describedAs(io.fabric8.kubernetes.assertions.Assertions.joinDescription(this, "series"));
}
/**
* Navigates to the property source so that assertions can be done on it
*/
public EventSourceAssert source() {
// check that actual Event we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (EventSourceAssert) assertThat(actual.getSource()).describedAs(io.fabric8.kubernetes.assertions.Assertions.joinDescription(this, "source"));
}
/**
* Navigates to the property type so that assertions can be done on it
*/
public org.assertj.core.api.StringAssert type() {
// check that actual Event we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (org.assertj.core.api.StringAssert) assertThat(actual.getType()).describedAs(io.fabric8.kubernetes.assertions.Assertions.joinDescription(this, "type"));
}
}