io.fabric8.kubernetes.api.model.AbstractConfigAssert 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.kubernetes.api.model;
import org.assertj.core.api.AbstractAssert;
import org.assertj.core.api.Assertions;
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 Config} specific assertions - Generated by CustomAssertionGenerator.
*/
public abstract class AbstractConfigAssert, A extends Config> extends AbstractAssert {
/**
* Creates a new {@link AbstractConfigAssert}
to make assertions on actual Config.
* @param actual the Config we want to make assertions on.
*/
protected AbstractConfigAssert(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 Config 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"));
}
/**
* Navigates to the property apiVersion so that assertions can be done on it
*/
public org.assertj.core.api.StringAssert apiVersion() {
// check that actual Config 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(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "apiVersion"));
}
/**
* Navigates to the property clusters so that assertions can be done on it
*/
public NavigationListAssert clusters() {
isNotNull();
// return the assertion for the property
AssertFactory assertFactory = new AssertFactory() {
public NamedClusterAssert createAssert(NamedCluster t) {
return (NamedClusterAssert) assertThat(t);
}
};
NavigationListAssert answer = new NavigationListAssert(actual.getClusters(), assertFactory);
answer.describedAs(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "clusters"));
return answer;
}
/**
* Navigates to the property contexts so that assertions can be done on it
*/
public NavigationListAssert contexts() {
isNotNull();
// return the assertion for the property
AssertFactory assertFactory = new AssertFactory() {
public NamedContextAssert createAssert(NamedContext t) {
return (NamedContextAssert) assertThat(t);
}
};
NavigationListAssert answer = new NavigationListAssert(actual.getContexts(), assertFactory);
answer.describedAs(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "contexts"));
return answer;
}
/**
* Navigates to the property currentContext so that assertions can be done on it
*/
public org.assertj.core.api.StringAssert currentContext() {
// check that actual Config we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (org.assertj.core.api.StringAssert) assertThat(actual.getCurrentContext()).describedAs(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "currentContext"));
}
/**
* Navigates to the property extensions so that assertions can be done on it
*/
public NavigationListAssert extensions() {
isNotNull();
// return the assertion for the property
AssertFactory assertFactory = new AssertFactory() {
public NamedExtensionAssert createAssert(NamedExtension t) {
return (NamedExtensionAssert) assertThat(t);
}
};
NavigationListAssert answer = new NavigationListAssert(actual.getExtensions(), assertFactory);
answer.describedAs(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "extensions"));
return answer;
}
/**
* Navigates to the property kind so that assertions can be done on it
*/
public org.assertj.core.api.StringAssert kind() {
// check that actual Config 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(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "kind"));
}
/**
* Navigates to the property preferences so that assertions can be done on it
*/
public PreferencesAssert preferences() {
// check that actual Config we want to make assertions on is not null.
isNotNull();
// return the assertion for the property
return (PreferencesAssert) assertThat(actual.getPreferences()).describedAs(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "preferences"));
}
/**
* Navigates to the property users so that assertions can be done on it
*/
public NavigationListAssert users() {
isNotNull();
// return the assertion for the property
AssertFactory assertFactory = new AssertFactory() {
public NamedAuthInfoAssert createAssert(NamedAuthInfo t) {
return (NamedAuthInfoAssert) assertThat(t);
}
};
NavigationListAssert answer = new NavigationListAssert(actual.getUsers(), assertFactory);
answer.describedAs(com.stakater.kubernetes.assertions.Assertions.joinDescription(this, "users"));
return answer;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy