Search in sources :

Example 1 with DeletionPropagation

use of io.fabric8.kubernetes.api.model.DeletionPropagation in project strimzi by strimzi.

the class StatefulSetOperatorTest method testNonCascadingDeleteAsync.

@Test
public void testNonCascadingDeleteAsync(VertxTestContext context) {
    Deletable mockDeletable = mock(Deletable.class);
    when(mockDeletable.delete()).thenReturn(Boolean.TRUE);
    Resource mockERPD = mock(resourceType());
    when(mockERPD.withPropagationPolicy(any(DeletionPropagation.class))).thenReturn(mockDeletable);
    when(mockERPD.withGracePeriod(anyLong())).thenReturn(mockDeletable);
    RollableScalableResource mockRSR = mock(RollableScalableResource.class);
    ArgumentCaptor<DeletionPropagation> cascadingCaptor = ArgumentCaptor.forClass(DeletionPropagation.class);
    when(mockRSR.withPropagationPolicy(cascadingCaptor.capture())).thenReturn(mockERPD);
    ArgumentCaptor<Watcher> watcherCaptor = ArgumentCaptor.forClass(Watcher.class);
    when(mockRSR.watch(watcherCaptor.capture())).thenReturn(mock(Watch.class));
    NonNamespaceOperation mockNameable = mock(NonNamespaceOperation.class);
    when(mockNameable.withName(matches(RESOURCE_NAME))).thenReturn(mockRSR);
    MixedOperation mockCms = mock(MixedOperation.class);
    when(mockCms.inNamespace(matches(NAMESPACE))).thenReturn(mockNameable);
    PodOperator podOperator = mock(PodOperator.class);
    PvcOperator pvcOperator = mock(PvcOperator.class);
    KubernetesClient mockClient = mock(KubernetesClient.class);
    mocker(mockClient, mockCms);
    StatefulSetOperator op = new StatefulSetOperator(AbstractResourceOperatorTest.vertx, mockClient, 5_000L, podOperator, pvcOperator) {

        @Override
        protected boolean shouldIncrementGeneration(Reconciliation reconciliation, StatefulSetDiff diff) {
            return true;
        }
    };
    Checkpoint a = context.checkpoint();
    op.deleteAsync(new Reconciliation("test", "kind", "namespace", "name"), NAMESPACE, RESOURCE_NAME, false).onComplete(context.succeeding(v -> context.verify(() -> {
        assertThat(cascadingCaptor.getValue(), is(DeletionPropagation.ORPHAN));
        a.flag();
    })));
}
Also used : Quantity(io.fabric8.kubernetes.api.model.Quantity) StatefulSetBuilder(io.fabric8.kubernetes.api.model.apps.StatefulSetBuilder) AbstractScalableResourceOperator(io.strimzi.operator.common.operator.resource.AbstractScalableResourceOperator) VertxTestContext(io.vertx.junit5.VertxTestContext) CoreMatchers.is(org.hamcrest.CoreMatchers.is) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) DeletionPropagation(io.fabric8.kubernetes.api.model.DeletionPropagation) MixedOperation(io.fabric8.kubernetes.client.dsl.MixedOperation) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) ScalableResourceOperatorTest(io.strimzi.operator.common.operator.resource.ScalableResourceOperatorTest) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Watcher(io.fabric8.kubernetes.client.Watcher) Watch(io.fabric8.kubernetes.client.Watch) HashMap(java.util.HashMap) MockitoException(org.mockito.exceptions.base.MockitoException) CoreMatchers.instanceOf(org.hamcrest.CoreMatchers.instanceOf) BiPredicate(java.util.function.BiPredicate) Resource(io.fabric8.kubernetes.client.dsl.Resource) RollableScalableResource(io.fabric8.kubernetes.client.dsl.RollableScalableResource) ArgumentCaptor(org.mockito.ArgumentCaptor) PodBuilder(io.fabric8.kubernetes.api.model.PodBuilder) StatefulSetList(io.fabric8.kubernetes.api.model.apps.StatefulSetList) Map(java.util.Map) PodOperator(io.strimzi.operator.common.operator.resource.PodOperator) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Deletable(io.fabric8.kubernetes.client.dsl.Deletable) EditReplacePatchDeletable(io.fabric8.kubernetes.client.dsl.EditReplacePatchDeletable) AbstractResourceOperatorTest(io.strimzi.operator.common.operator.resource.AbstractResourceOperatorTest) Vertx(io.vertx.core.Vertx) Mockito.when(org.mockito.Mockito.when) StatefulSet(io.fabric8.kubernetes.api.model.apps.StatefulSet) PvcOperator(io.strimzi.operator.common.operator.resource.PvcOperator) Future(io.vertx.core.Future) Mockito.verify(org.mockito.Mockito.verify) Test(org.junit.jupiter.api.Test) Reconciliation(io.strimzi.operator.common.Reconciliation) NonNamespaceOperation(io.fabric8.kubernetes.client.dsl.NonNamespaceOperation) ArgumentMatchers.matches(org.mockito.ArgumentMatchers.matches) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) PersistentVolumeClaim(io.fabric8.kubernetes.api.model.PersistentVolumeClaim) Checkpoint(io.vertx.junit5.Checkpoint) AppsAPIGroupDSL(io.fabric8.kubernetes.client.dsl.AppsAPIGroupDSL) PersistentVolumeClaimBuilder(io.fabric8.kubernetes.api.model.PersistentVolumeClaimBuilder) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Mockito.mock(org.mockito.Mockito.mock) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) PodOperator(io.strimzi.operator.common.operator.resource.PodOperator) Resource(io.fabric8.kubernetes.client.dsl.Resource) RollableScalableResource(io.fabric8.kubernetes.client.dsl.RollableScalableResource) DeletionPropagation(io.fabric8.kubernetes.api.model.DeletionPropagation) Watcher(io.fabric8.kubernetes.client.Watcher) PvcOperator(io.strimzi.operator.common.operator.resource.PvcOperator) NonNamespaceOperation(io.fabric8.kubernetes.client.dsl.NonNamespaceOperation) Checkpoint(io.vertx.junit5.Checkpoint) Reconciliation(io.strimzi.operator.common.Reconciliation) RollableScalableResource(io.fabric8.kubernetes.client.dsl.RollableScalableResource) Watch(io.fabric8.kubernetes.client.Watch) Deletable(io.fabric8.kubernetes.client.dsl.Deletable) EditReplacePatchDeletable(io.fabric8.kubernetes.client.dsl.EditReplacePatchDeletable) MixedOperation(io.fabric8.kubernetes.client.dsl.MixedOperation) ScalableResourceOperatorTest(io.strimzi.operator.common.operator.resource.ScalableResourceOperatorTest) AbstractResourceOperatorTest(io.strimzi.operator.common.operator.resource.AbstractResourceOperatorTest) Test(org.junit.jupiter.api.Test)

Example 2 with DeletionPropagation

use of io.fabric8.kubernetes.api.model.DeletionPropagation in project strimzi-kafka-operator by strimzi.

the class StatefulSetOperatorTest method testNonCascadingDeleteAsync.

@Test
public void testNonCascadingDeleteAsync(VertxTestContext context) {
    Deletable mockDeletable = mock(Deletable.class);
    when(mockDeletable.delete()).thenReturn(Boolean.TRUE);
    Resource mockERPD = mock(resourceType());
    when(mockERPD.withPropagationPolicy(any(DeletionPropagation.class))).thenReturn(mockDeletable);
    when(mockERPD.withGracePeriod(anyLong())).thenReturn(mockDeletable);
    RollableScalableResource mockRSR = mock(RollableScalableResource.class);
    ArgumentCaptor<DeletionPropagation> cascadingCaptor = ArgumentCaptor.forClass(DeletionPropagation.class);
    when(mockRSR.withPropagationPolicy(cascadingCaptor.capture())).thenReturn(mockERPD);
    ArgumentCaptor<Watcher> watcherCaptor = ArgumentCaptor.forClass(Watcher.class);
    when(mockRSR.watch(watcherCaptor.capture())).thenReturn(mock(Watch.class));
    NonNamespaceOperation mockNameable = mock(NonNamespaceOperation.class);
    when(mockNameable.withName(matches(RESOURCE_NAME))).thenReturn(mockRSR);
    MixedOperation mockCms = mock(MixedOperation.class);
    when(mockCms.inNamespace(matches(NAMESPACE))).thenReturn(mockNameable);
    PodOperator podOperator = mock(PodOperator.class);
    PvcOperator pvcOperator = mock(PvcOperator.class);
    KubernetesClient mockClient = mock(KubernetesClient.class);
    mocker(mockClient, mockCms);
    StatefulSetOperator op = new StatefulSetOperator(AbstractResourceOperatorTest.vertx, mockClient, 5_000L, podOperator, pvcOperator) {

        @Override
        protected boolean shouldIncrementGeneration(Reconciliation reconciliation, StatefulSetDiff diff) {
            return true;
        }
    };
    Checkpoint a = context.checkpoint();
    op.deleteAsync(new Reconciliation("test", "kind", "namespace", "name"), NAMESPACE, RESOURCE_NAME, false).onComplete(context.succeeding(v -> context.verify(() -> {
        assertThat(cascadingCaptor.getValue(), is(DeletionPropagation.ORPHAN));
        a.flag();
    })));
}
Also used : Quantity(io.fabric8.kubernetes.api.model.Quantity) StatefulSetBuilder(io.fabric8.kubernetes.api.model.apps.StatefulSetBuilder) AbstractScalableResourceOperator(io.strimzi.operator.common.operator.resource.AbstractScalableResourceOperator) VertxTestContext(io.vertx.junit5.VertxTestContext) CoreMatchers.is(org.hamcrest.CoreMatchers.is) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) DeletionPropagation(io.fabric8.kubernetes.api.model.DeletionPropagation) MixedOperation(io.fabric8.kubernetes.client.dsl.MixedOperation) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) ScalableResourceOperatorTest(io.strimzi.operator.common.operator.resource.ScalableResourceOperatorTest) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Watcher(io.fabric8.kubernetes.client.Watcher) Watch(io.fabric8.kubernetes.client.Watch) HashMap(java.util.HashMap) MockitoException(org.mockito.exceptions.base.MockitoException) CoreMatchers.instanceOf(org.hamcrest.CoreMatchers.instanceOf) BiPredicate(java.util.function.BiPredicate) Resource(io.fabric8.kubernetes.client.dsl.Resource) RollableScalableResource(io.fabric8.kubernetes.client.dsl.RollableScalableResource) ArgumentCaptor(org.mockito.ArgumentCaptor) PodBuilder(io.fabric8.kubernetes.api.model.PodBuilder) StatefulSetList(io.fabric8.kubernetes.api.model.apps.StatefulSetList) Map(java.util.Map) PodOperator(io.strimzi.operator.common.operator.resource.PodOperator) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Deletable(io.fabric8.kubernetes.client.dsl.Deletable) EditReplacePatchDeletable(io.fabric8.kubernetes.client.dsl.EditReplacePatchDeletable) AbstractResourceOperatorTest(io.strimzi.operator.common.operator.resource.AbstractResourceOperatorTest) Vertx(io.vertx.core.Vertx) Mockito.when(org.mockito.Mockito.when) StatefulSet(io.fabric8.kubernetes.api.model.apps.StatefulSet) PvcOperator(io.strimzi.operator.common.operator.resource.PvcOperator) Future(io.vertx.core.Future) Mockito.verify(org.mockito.Mockito.verify) Test(org.junit.jupiter.api.Test) Reconciliation(io.strimzi.operator.common.Reconciliation) NonNamespaceOperation(io.fabric8.kubernetes.client.dsl.NonNamespaceOperation) ArgumentMatchers.matches(org.mockito.ArgumentMatchers.matches) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) PersistentVolumeClaim(io.fabric8.kubernetes.api.model.PersistentVolumeClaim) Checkpoint(io.vertx.junit5.Checkpoint) AppsAPIGroupDSL(io.fabric8.kubernetes.client.dsl.AppsAPIGroupDSL) PersistentVolumeClaimBuilder(io.fabric8.kubernetes.api.model.PersistentVolumeClaimBuilder) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Mockito.mock(org.mockito.Mockito.mock) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) PodOperator(io.strimzi.operator.common.operator.resource.PodOperator) Resource(io.fabric8.kubernetes.client.dsl.Resource) RollableScalableResource(io.fabric8.kubernetes.client.dsl.RollableScalableResource) DeletionPropagation(io.fabric8.kubernetes.api.model.DeletionPropagation) Watcher(io.fabric8.kubernetes.client.Watcher) PvcOperator(io.strimzi.operator.common.operator.resource.PvcOperator) NonNamespaceOperation(io.fabric8.kubernetes.client.dsl.NonNamespaceOperation) Checkpoint(io.vertx.junit5.Checkpoint) Reconciliation(io.strimzi.operator.common.Reconciliation) RollableScalableResource(io.fabric8.kubernetes.client.dsl.RollableScalableResource) Watch(io.fabric8.kubernetes.client.Watch) Deletable(io.fabric8.kubernetes.client.dsl.Deletable) EditReplacePatchDeletable(io.fabric8.kubernetes.client.dsl.EditReplacePatchDeletable) MixedOperation(io.fabric8.kubernetes.client.dsl.MixedOperation) ScalableResourceOperatorTest(io.strimzi.operator.common.operator.resource.ScalableResourceOperatorTest) AbstractResourceOperatorTest(io.strimzi.operator.common.operator.resource.AbstractResourceOperatorTest) Test(org.junit.jupiter.api.Test)

Example 3 with DeletionPropagation

use of io.fabric8.kubernetes.api.model.DeletionPropagation in project strimzi by strimzi.

the class StatefulSetOperatorTest method testCascadingDeleteAsync.

@Test
public void testCascadingDeleteAsync(VertxTestContext context) {
    Deletable mockDeletable = mock(Deletable.class);
    when(mockDeletable.delete()).thenReturn(Boolean.TRUE);
    Resource mockERPD = mock(resourceType());
    when(mockERPD.withPropagationPolicy(any(DeletionPropagation.class))).thenReturn(mockDeletable);
    when(mockERPD.withGracePeriod(anyLong())).thenReturn(mockDeletable);
    RollableScalableResource mockRSR = mock(RollableScalableResource.class);
    ArgumentCaptor<DeletionPropagation> cascadingCaptor = ArgumentCaptor.forClass(DeletionPropagation.class);
    when(mockRSR.withPropagationPolicy(cascadingCaptor.capture())).thenReturn(mockERPD);
    ArgumentCaptor<Watcher> watcherCaptor = ArgumentCaptor.forClass(Watcher.class);
    when(mockRSR.watch(watcherCaptor.capture())).thenReturn(mock(Watch.class));
    NonNamespaceOperation mockNameable = mock(NonNamespaceOperation.class);
    when(mockNameable.withName(matches(RESOURCE_NAME))).thenReturn(mockRSR);
    MixedOperation mockCms = mock(MixedOperation.class);
    when(mockCms.inNamespace(matches(NAMESPACE))).thenReturn(mockNameable);
    PodOperator podOperator = mock(PodOperator.class);
    PvcOperator pvcOperator = mock(PvcOperator.class);
    KubernetesClient mockClient = mock(KubernetesClient.class);
    mocker(mockClient, mockCms);
    StatefulSetOperator op = new StatefulSetOperator(AbstractResourceOperatorTest.vertx, mockClient, 5_000L, podOperator, pvcOperator) {

        @Override
        protected boolean shouldIncrementGeneration(Reconciliation reconciliation, StatefulSetDiff diff) {
            return true;
        }
    };
    Checkpoint async = context.checkpoint();
    op.deleteAsync(new Reconciliation("test", "kind", "namespace", "name"), NAMESPACE, RESOURCE_NAME, true).onComplete(context.succeeding(v -> context.verify(() -> {
        assertThat(cascadingCaptor.getValue(), is(DeletionPropagation.FOREGROUND));
        async.flag();
    })));
}
Also used : Quantity(io.fabric8.kubernetes.api.model.Quantity) StatefulSetBuilder(io.fabric8.kubernetes.api.model.apps.StatefulSetBuilder) AbstractScalableResourceOperator(io.strimzi.operator.common.operator.resource.AbstractScalableResourceOperator) VertxTestContext(io.vertx.junit5.VertxTestContext) CoreMatchers.is(org.hamcrest.CoreMatchers.is) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) DeletionPropagation(io.fabric8.kubernetes.api.model.DeletionPropagation) MixedOperation(io.fabric8.kubernetes.client.dsl.MixedOperation) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) ScalableResourceOperatorTest(io.strimzi.operator.common.operator.resource.ScalableResourceOperatorTest) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Watcher(io.fabric8.kubernetes.client.Watcher) Watch(io.fabric8.kubernetes.client.Watch) HashMap(java.util.HashMap) MockitoException(org.mockito.exceptions.base.MockitoException) CoreMatchers.instanceOf(org.hamcrest.CoreMatchers.instanceOf) BiPredicate(java.util.function.BiPredicate) Resource(io.fabric8.kubernetes.client.dsl.Resource) RollableScalableResource(io.fabric8.kubernetes.client.dsl.RollableScalableResource) ArgumentCaptor(org.mockito.ArgumentCaptor) PodBuilder(io.fabric8.kubernetes.api.model.PodBuilder) StatefulSetList(io.fabric8.kubernetes.api.model.apps.StatefulSetList) Map(java.util.Map) PodOperator(io.strimzi.operator.common.operator.resource.PodOperator) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Deletable(io.fabric8.kubernetes.client.dsl.Deletable) EditReplacePatchDeletable(io.fabric8.kubernetes.client.dsl.EditReplacePatchDeletable) AbstractResourceOperatorTest(io.strimzi.operator.common.operator.resource.AbstractResourceOperatorTest) Vertx(io.vertx.core.Vertx) Mockito.when(org.mockito.Mockito.when) StatefulSet(io.fabric8.kubernetes.api.model.apps.StatefulSet) PvcOperator(io.strimzi.operator.common.operator.resource.PvcOperator) Future(io.vertx.core.Future) Mockito.verify(org.mockito.Mockito.verify) Test(org.junit.jupiter.api.Test) Reconciliation(io.strimzi.operator.common.Reconciliation) NonNamespaceOperation(io.fabric8.kubernetes.client.dsl.NonNamespaceOperation) ArgumentMatchers.matches(org.mockito.ArgumentMatchers.matches) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) PersistentVolumeClaim(io.fabric8.kubernetes.api.model.PersistentVolumeClaim) Checkpoint(io.vertx.junit5.Checkpoint) AppsAPIGroupDSL(io.fabric8.kubernetes.client.dsl.AppsAPIGroupDSL) PersistentVolumeClaimBuilder(io.fabric8.kubernetes.api.model.PersistentVolumeClaimBuilder) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Mockito.mock(org.mockito.Mockito.mock) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) PodOperator(io.strimzi.operator.common.operator.resource.PodOperator) Resource(io.fabric8.kubernetes.client.dsl.Resource) RollableScalableResource(io.fabric8.kubernetes.client.dsl.RollableScalableResource) DeletionPropagation(io.fabric8.kubernetes.api.model.DeletionPropagation) Watcher(io.fabric8.kubernetes.client.Watcher) PvcOperator(io.strimzi.operator.common.operator.resource.PvcOperator) NonNamespaceOperation(io.fabric8.kubernetes.client.dsl.NonNamespaceOperation) Checkpoint(io.vertx.junit5.Checkpoint) Reconciliation(io.strimzi.operator.common.Reconciliation) RollableScalableResource(io.fabric8.kubernetes.client.dsl.RollableScalableResource) Watch(io.fabric8.kubernetes.client.Watch) Deletable(io.fabric8.kubernetes.client.dsl.Deletable) EditReplacePatchDeletable(io.fabric8.kubernetes.client.dsl.EditReplacePatchDeletable) MixedOperation(io.fabric8.kubernetes.client.dsl.MixedOperation) ScalableResourceOperatorTest(io.strimzi.operator.common.operator.resource.ScalableResourceOperatorTest) AbstractResourceOperatorTest(io.strimzi.operator.common.operator.resource.AbstractResourceOperatorTest) Test(org.junit.jupiter.api.Test)

Example 4 with DeletionPropagation

use of io.fabric8.kubernetes.api.model.DeletionPropagation in project strimzi-kafka-operator by strimzi.

the class StatefulSetOperatorTest method testCascadingDeleteAsync.

@Test
public void testCascadingDeleteAsync(VertxTestContext context) {
    Deletable mockDeletable = mock(Deletable.class);
    when(mockDeletable.delete()).thenReturn(Boolean.TRUE);
    Resource mockERPD = mock(resourceType());
    when(mockERPD.withPropagationPolicy(any(DeletionPropagation.class))).thenReturn(mockDeletable);
    when(mockERPD.withGracePeriod(anyLong())).thenReturn(mockDeletable);
    RollableScalableResource mockRSR = mock(RollableScalableResource.class);
    ArgumentCaptor<DeletionPropagation> cascadingCaptor = ArgumentCaptor.forClass(DeletionPropagation.class);
    when(mockRSR.withPropagationPolicy(cascadingCaptor.capture())).thenReturn(mockERPD);
    ArgumentCaptor<Watcher> watcherCaptor = ArgumentCaptor.forClass(Watcher.class);
    when(mockRSR.watch(watcherCaptor.capture())).thenReturn(mock(Watch.class));
    NonNamespaceOperation mockNameable = mock(NonNamespaceOperation.class);
    when(mockNameable.withName(matches(RESOURCE_NAME))).thenReturn(mockRSR);
    MixedOperation mockCms = mock(MixedOperation.class);
    when(mockCms.inNamespace(matches(NAMESPACE))).thenReturn(mockNameable);
    PodOperator podOperator = mock(PodOperator.class);
    PvcOperator pvcOperator = mock(PvcOperator.class);
    KubernetesClient mockClient = mock(KubernetesClient.class);
    mocker(mockClient, mockCms);
    StatefulSetOperator op = new StatefulSetOperator(AbstractResourceOperatorTest.vertx, mockClient, 5_000L, podOperator, pvcOperator) {

        @Override
        protected boolean shouldIncrementGeneration(Reconciliation reconciliation, StatefulSetDiff diff) {
            return true;
        }
    };
    Checkpoint async = context.checkpoint();
    op.deleteAsync(new Reconciliation("test", "kind", "namespace", "name"), NAMESPACE, RESOURCE_NAME, true).onComplete(context.succeeding(v -> context.verify(() -> {
        assertThat(cascadingCaptor.getValue(), is(DeletionPropagation.FOREGROUND));
        async.flag();
    })));
}
Also used : Quantity(io.fabric8.kubernetes.api.model.Quantity) StatefulSetBuilder(io.fabric8.kubernetes.api.model.apps.StatefulSetBuilder) AbstractScalableResourceOperator(io.strimzi.operator.common.operator.resource.AbstractScalableResourceOperator) VertxTestContext(io.vertx.junit5.VertxTestContext) CoreMatchers.is(org.hamcrest.CoreMatchers.is) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) DeletionPropagation(io.fabric8.kubernetes.api.model.DeletionPropagation) MixedOperation(io.fabric8.kubernetes.client.dsl.MixedOperation) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) ScalableResourceOperatorTest(io.strimzi.operator.common.operator.resource.ScalableResourceOperatorTest) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Watcher(io.fabric8.kubernetes.client.Watcher) Watch(io.fabric8.kubernetes.client.Watch) HashMap(java.util.HashMap) MockitoException(org.mockito.exceptions.base.MockitoException) CoreMatchers.instanceOf(org.hamcrest.CoreMatchers.instanceOf) BiPredicate(java.util.function.BiPredicate) Resource(io.fabric8.kubernetes.client.dsl.Resource) RollableScalableResource(io.fabric8.kubernetes.client.dsl.RollableScalableResource) ArgumentCaptor(org.mockito.ArgumentCaptor) PodBuilder(io.fabric8.kubernetes.api.model.PodBuilder) StatefulSetList(io.fabric8.kubernetes.api.model.apps.StatefulSetList) Map(java.util.Map) PodOperator(io.strimzi.operator.common.operator.resource.PodOperator) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Deletable(io.fabric8.kubernetes.client.dsl.Deletable) EditReplacePatchDeletable(io.fabric8.kubernetes.client.dsl.EditReplacePatchDeletable) AbstractResourceOperatorTest(io.strimzi.operator.common.operator.resource.AbstractResourceOperatorTest) Vertx(io.vertx.core.Vertx) Mockito.when(org.mockito.Mockito.when) StatefulSet(io.fabric8.kubernetes.api.model.apps.StatefulSet) PvcOperator(io.strimzi.operator.common.operator.resource.PvcOperator) Future(io.vertx.core.Future) Mockito.verify(org.mockito.Mockito.verify) Test(org.junit.jupiter.api.Test) Reconciliation(io.strimzi.operator.common.Reconciliation) NonNamespaceOperation(io.fabric8.kubernetes.client.dsl.NonNamespaceOperation) ArgumentMatchers.matches(org.mockito.ArgumentMatchers.matches) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) PersistentVolumeClaim(io.fabric8.kubernetes.api.model.PersistentVolumeClaim) Checkpoint(io.vertx.junit5.Checkpoint) AppsAPIGroupDSL(io.fabric8.kubernetes.client.dsl.AppsAPIGroupDSL) PersistentVolumeClaimBuilder(io.fabric8.kubernetes.api.model.PersistentVolumeClaimBuilder) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Mockito.mock(org.mockito.Mockito.mock) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) PodOperator(io.strimzi.operator.common.operator.resource.PodOperator) Resource(io.fabric8.kubernetes.client.dsl.Resource) RollableScalableResource(io.fabric8.kubernetes.client.dsl.RollableScalableResource) DeletionPropagation(io.fabric8.kubernetes.api.model.DeletionPropagation) Watcher(io.fabric8.kubernetes.client.Watcher) PvcOperator(io.strimzi.operator.common.operator.resource.PvcOperator) NonNamespaceOperation(io.fabric8.kubernetes.client.dsl.NonNamespaceOperation) Checkpoint(io.vertx.junit5.Checkpoint) Reconciliation(io.strimzi.operator.common.Reconciliation) RollableScalableResource(io.fabric8.kubernetes.client.dsl.RollableScalableResource) Watch(io.fabric8.kubernetes.client.Watch) Deletable(io.fabric8.kubernetes.client.dsl.Deletable) EditReplacePatchDeletable(io.fabric8.kubernetes.client.dsl.EditReplacePatchDeletable) MixedOperation(io.fabric8.kubernetes.client.dsl.MixedOperation) ScalableResourceOperatorTest(io.strimzi.operator.common.operator.resource.ScalableResourceOperatorTest) AbstractResourceOperatorTest(io.strimzi.operator.common.operator.resource.AbstractResourceOperatorTest) Test(org.junit.jupiter.api.Test)

Aggregations

DeletionPropagation (io.fabric8.kubernetes.api.model.DeletionPropagation)4 PersistentVolumeClaim (io.fabric8.kubernetes.api.model.PersistentVolumeClaim)4 PersistentVolumeClaimBuilder (io.fabric8.kubernetes.api.model.PersistentVolumeClaimBuilder)4 PodBuilder (io.fabric8.kubernetes.api.model.PodBuilder)4 Quantity (io.fabric8.kubernetes.api.model.Quantity)4 StatefulSet (io.fabric8.kubernetes.api.model.apps.StatefulSet)4 StatefulSetBuilder (io.fabric8.kubernetes.api.model.apps.StatefulSetBuilder)4 StatefulSetList (io.fabric8.kubernetes.api.model.apps.StatefulSetList)4 KubernetesClient (io.fabric8.kubernetes.client.KubernetesClient)4 Watch (io.fabric8.kubernetes.client.Watch)4 Watcher (io.fabric8.kubernetes.client.Watcher)4 AppsAPIGroupDSL (io.fabric8.kubernetes.client.dsl.AppsAPIGroupDSL)4 Deletable (io.fabric8.kubernetes.client.dsl.Deletable)4 EditReplacePatchDeletable (io.fabric8.kubernetes.client.dsl.EditReplacePatchDeletable)4 MixedOperation (io.fabric8.kubernetes.client.dsl.MixedOperation)4 NonNamespaceOperation (io.fabric8.kubernetes.client.dsl.NonNamespaceOperation)4 Resource (io.fabric8.kubernetes.client.dsl.Resource)4 RollableScalableResource (io.fabric8.kubernetes.client.dsl.RollableScalableResource)4 Reconciliation (io.strimzi.operator.common.Reconciliation)4 AbstractResourceOperatorTest (io.strimzi.operator.common.operator.resource.AbstractResourceOperatorTest)4