Class AbstractOperatorExtension
- java.lang.Object
-
- io.javaoperatorsdk.operator.junit.AbstractOperatorExtension
-
- All Implemented Interfaces:
HasKubernetesClient,org.junit.jupiter.api.extension.AfterAllCallback,org.junit.jupiter.api.extension.AfterEachCallback,org.junit.jupiter.api.extension.BeforeAllCallback,org.junit.jupiter.api.extension.BeforeEachCallback,org.junit.jupiter.api.extension.Extension
- Direct Known Subclasses:
ClusterDeployedOperatorExtension,LocallyRunOperatorExtension
public abstract class AbstractOperatorExtension extends Object implements HasKubernetesClient, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.AfterEachCallback
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractOperatorExtension.AbstractBuilder<T extends AbstractOperatorExtension.AbstractBuilder<T>>
-
Field Summary
Fields Modifier and Type Field Description static intCRD_READY_WAITstatic intDEFAULT_NAMESPACE_DELETE_TIMEOUTprotected List<io.fabric8.kubernetes.api.model.HasMetadata>infrastructureprotected DurationinfrastructureTimeoutstatic intMAX_NAMESPACE_NAME_LENGTHprotected Stringnamespaceprotected intnamespaceDeleteTimeoutprotected Function<org.junit.jupiter.api.extension.ExtensionContext,String>namespaceNameSupplierprotected booleanoneNamespacePerClassprotected Function<org.junit.jupiter.api.extension.ExtensionContext,String>perClassNamespaceNameSupplierprotected booleanpreserveNamespaceOnErrorprotected booleanwaitForNamespaceDeletion
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractOperatorExtension(List<io.fabric8.kubernetes.api.model.HasMetadata> infrastructure, Duration infrastructureTimeout, boolean oneNamespacePerClass, boolean preserveNamespaceOnError, boolean waitForNamespaceDeletion, io.fabric8.kubernetes.client.KubernetesClient kubernetesClient, Function<org.junit.jupiter.api.extension.ExtensionContext,String> namespaceNameSupplier, Function<org.junit.jupiter.api.extension.ExtensionContext,String> perClassNamespaceNameSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidafter(org.junit.jupiter.api.extension.ExtensionContext context)voidafterAll(org.junit.jupiter.api.extension.ExtensionContext context)protected voidafterAllImpl(org.junit.jupiter.api.extension.ExtensionContext context)voidafterEach(org.junit.jupiter.api.extension.ExtensionContext context)protected voidafterEachImpl(org.junit.jupiter.api.extension.ExtensionContext context)protected voidbefore(org.junit.jupiter.api.extension.ExtensionContext context)voidbeforeAll(org.junit.jupiter.api.extension.ExtensionContext context)protected voidbeforeAllImpl(org.junit.jupiter.api.extension.ExtensionContext context)voidbeforeEach(org.junit.jupiter.api.extension.ExtensionContext context)protected voidbeforeEachImpl(org.junit.jupiter.api.extension.ExtensionContext context)<T extends io.fabric8.kubernetes.api.model.HasMetadata>
Tcreate(Class<T> type, T resource)Deprecated, for removal: This API element is subject to removal in a future version.<T extends io.fabric8.kubernetes.api.model.HasMetadata>
Tcreate(T resource)<T extends io.fabric8.kubernetes.api.model.HasMetadata>
booleandelete(Class<T> type, T resource)Deprecated, for removal: This API element is subject to removal in a future version.<T extends io.fabric8.kubernetes.api.model.HasMetadata>
booleandelete(T resource)protected voiddeleteOperator()<T extends io.fabric8.kubernetes.api.model.HasMetadata>
Tget(Class<T> type, String name)io.fabric8.kubernetes.client.KubernetesClientgetKubernetesClient()StringgetNamespace()<T extends io.fabric8.kubernetes.api.model.HasMetadata>
Treplace(Class<T> type, T resource)Deprecated, for removal: This API element is subject to removal in a future version.<T extends io.fabric8.kubernetes.api.model.HasMetadata>
Treplace(T resource)<T extends io.fabric8.kubernetes.api.model.HasMetadata>
io.fabric8.kubernetes.client.dsl.NonNamespaceOperation<T,io.fabric8.kubernetes.api.model.KubernetesResourceList<T>,io.fabric8.kubernetes.client.dsl.Resource<T>>resources(Class<T> type)
-
-
-
Field Detail
-
MAX_NAMESPACE_NAME_LENGTH
public static final int MAX_NAMESPACE_NAME_LENGTH
- See Also:
- Constant Field Values
-
CRD_READY_WAIT
public static final int CRD_READY_WAIT
- See Also:
- Constant Field Values
-
DEFAULT_NAMESPACE_DELETE_TIMEOUT
public static final int DEFAULT_NAMESPACE_DELETE_TIMEOUT
- See Also:
- Constant Field Values
-
infrastructure
protected final List<io.fabric8.kubernetes.api.model.HasMetadata> infrastructure
-
infrastructureTimeout
protected Duration infrastructureTimeout
-
oneNamespacePerClass
protected final boolean oneNamespacePerClass
-
preserveNamespaceOnError
protected final boolean preserveNamespaceOnError
-
waitForNamespaceDeletion
protected final boolean waitForNamespaceDeletion
-
namespaceDeleteTimeout
protected final int namespaceDeleteTimeout
- See Also:
- Constant Field Values
-
namespaceNameSupplier
protected final Function<org.junit.jupiter.api.extension.ExtensionContext,String> namespaceNameSupplier
-
perClassNamespaceNameSupplier
protected final Function<org.junit.jupiter.api.extension.ExtensionContext,String> perClassNamespaceNameSupplier
-
namespace
protected String namespace
-
-
Constructor Detail
-
AbstractOperatorExtension
protected AbstractOperatorExtension(List<io.fabric8.kubernetes.api.model.HasMetadata> infrastructure, Duration infrastructureTimeout, boolean oneNamespacePerClass, boolean preserveNamespaceOnError, boolean waitForNamespaceDeletion, io.fabric8.kubernetes.client.KubernetesClient kubernetesClient, Function<org.junit.jupiter.api.extension.ExtensionContext,String> namespaceNameSupplier, Function<org.junit.jupiter.api.extension.ExtensionContext,String> perClassNamespaceNameSupplier)
-
-
Method Detail
-
beforeAll
public void beforeAll(org.junit.jupiter.api.extension.ExtensionContext context)
- Specified by:
beforeAllin interfaceorg.junit.jupiter.api.extension.BeforeAllCallback
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context)
- Specified by:
beforeEachin interfaceorg.junit.jupiter.api.extension.BeforeEachCallback
-
afterAll
public void afterAll(org.junit.jupiter.api.extension.ExtensionContext context)
- Specified by:
afterAllin interfaceorg.junit.jupiter.api.extension.AfterAllCallback
-
afterEach
public void afterEach(org.junit.jupiter.api.extension.ExtensionContext context)
- Specified by:
afterEachin interfaceorg.junit.jupiter.api.extension.AfterEachCallback
-
getKubernetesClient
public io.fabric8.kubernetes.client.KubernetesClient getKubernetesClient()
- Specified by:
getKubernetesClientin interfaceHasKubernetesClient
-
getNamespace
public String getNamespace()
-
resources
public <T extends io.fabric8.kubernetes.api.model.HasMetadata> io.fabric8.kubernetes.client.dsl.NonNamespaceOperation<T,io.fabric8.kubernetes.api.model.KubernetesResourceList<T>,io.fabric8.kubernetes.client.dsl.Resource<T>> resources(Class<T> type)
-
get
public <T extends io.fabric8.kubernetes.api.model.HasMetadata> T get(Class<T> type, String name)
-
create
public <T extends io.fabric8.kubernetes.api.model.HasMetadata> T create(T resource)
-
create
@Deprecated(forRemoval=true) public <T extends io.fabric8.kubernetes.api.model.HasMetadata> T create(Class<T> type, T resource)
Deprecated, for removal: This API element is subject to removal in a future version.
-
replace
public <T extends io.fabric8.kubernetes.api.model.HasMetadata> T replace(T resource)
-
replace
@Deprecated(forRemoval=true) public <T extends io.fabric8.kubernetes.api.model.HasMetadata> T replace(Class<T> type, T resource)
Deprecated, for removal: This API element is subject to removal in a future version.
-
delete
public <T extends io.fabric8.kubernetes.api.model.HasMetadata> boolean delete(T resource)
-
delete
@Deprecated(forRemoval=true) public <T extends io.fabric8.kubernetes.api.model.HasMetadata> boolean delete(Class<T> type, T resource)
Deprecated, for removal: This API element is subject to removal in a future version.
-
beforeAllImpl
protected void beforeAllImpl(org.junit.jupiter.api.extension.ExtensionContext context)
-
beforeEachImpl
protected void beforeEachImpl(org.junit.jupiter.api.extension.ExtensionContext context)
-
before
protected void before(org.junit.jupiter.api.extension.ExtensionContext context)
-
afterAllImpl
protected void afterAllImpl(org.junit.jupiter.api.extension.ExtensionContext context)
-
afterEachImpl
protected void afterEachImpl(org.junit.jupiter.api.extension.ExtensionContext context)
-
after
protected void after(org.junit.jupiter.api.extension.ExtensionContext context)
-
deleteOperator
protected void deleteOperator()
-
-