Search in sources :

Example 1 with DrainCleanerManager

use of org.bf2.operator.managers.DrainCleanerManager in project kas-fleetshard by bf2fc6cc711aee1a0c2a.

the class KafkaClusterTest method testDrainCleanerWebhookNotFound.

@Test
void testDrainCleanerWebhookNotFound() throws IOException {
    DrainCleanerManager mock = Mockito.mock(DrainCleanerManager.class);
    Mockito.when(mock.isDrainCleanerWebhookFound()).thenReturn(false);
    QuarkusMock.installMockForType(mock, DrainCleanerManager.class);
    ManagedKafka mk = exampleManagedKafka("40Gi");
    Kafka kafka = kafkaCluster.kafkaFrom(mk, null);
    assertNull(kafka.getSpec().getKafka().getTemplate().getPodDisruptionBudget());
    assertNull(kafka.getSpec().getZookeeper().getTemplate().getPodDisruptionBudget());
}
Also used : ManagedKafkaUtils.exampleManagedKafka(org.bf2.operator.utils.ManagedKafkaUtils.exampleManagedKafka) ManagedKafka(org.bf2.operator.resources.v1alpha1.ManagedKafka) DrainCleanerManager(org.bf2.operator.managers.DrainCleanerManager) ManagedKafkaUtils.exampleManagedKafka(org.bf2.operator.utils.ManagedKafkaUtils.exampleManagedKafka) Kafka(io.strimzi.api.kafka.model.Kafka) ManagedKafka(org.bf2.operator.resources.v1alpha1.ManagedKafka) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 2 with DrainCleanerManager

use of org.bf2.operator.managers.DrainCleanerManager in project kas-fleetshard by bf2fc6cc711aee1a0c2a.

the class KafkaClusterTest method testDrainCleanerWebhookFound.

@Test
void testDrainCleanerWebhookFound() throws IOException {
    DrainCleanerManager mock = Mockito.mock(DrainCleanerManager.class);
    Mockito.when(mock.isDrainCleanerWebhookFound()).thenReturn(true);
    QuarkusMock.installMockForType(mock, DrainCleanerManager.class);
    ManagedKafka mk = exampleManagedKafka("40Gi");
    Kafka kafka = kafkaCluster.kafkaFrom(mk, null);
    assertEquals(0, kafka.getSpec().getKafka().getTemplate().getPodDisruptionBudget().getMaxUnavailable());
    assertEquals(0, kafka.getSpec().getZookeeper().getTemplate().getPodDisruptionBudget().getMaxUnavailable());
}
Also used : ManagedKafkaUtils.exampleManagedKafka(org.bf2.operator.utils.ManagedKafkaUtils.exampleManagedKafka) ManagedKafka(org.bf2.operator.resources.v1alpha1.ManagedKafka) DrainCleanerManager(org.bf2.operator.managers.DrainCleanerManager) ManagedKafkaUtils.exampleManagedKafka(org.bf2.operator.utils.ManagedKafkaUtils.exampleManagedKafka) Kafka(io.strimzi.api.kafka.model.Kafka) ManagedKafka(org.bf2.operator.resources.v1alpha1.ManagedKafka) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

QuarkusTest (io.quarkus.test.junit.QuarkusTest)2 Kafka (io.strimzi.api.kafka.model.Kafka)2 DrainCleanerManager (org.bf2.operator.managers.DrainCleanerManager)2 ManagedKafka (org.bf2.operator.resources.v1alpha1.ManagedKafka)2 ManagedKafkaUtils.exampleManagedKafka (org.bf2.operator.utils.ManagedKafkaUtils.exampleManagedKafka)2 Test (org.junit.jupiter.api.Test)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2