Search in sources :

Example 1 with PodDisruptionBudgetTemplate

use of io.strimzi.api.kafka.model.template.PodDisruptionBudgetTemplate in project strimzi by strimzi.

the class ModelUtilsTest method testParsePodDisruptionBudgetTemplate.

@Test
public void testParsePodDisruptionBudgetTemplate() {
    Kafka kafka = new KafkaBuilder().withNewMetadata().withName("my-cluster").withNamespace("my-namespace").endMetadata().build();
    PodDisruptionBudgetTemplate template = new PodDisruptionBudgetTemplateBuilder().withNewMetadata().withAnnotations(Collections.singletonMap("annoKey", "annoValue")).withLabels(Collections.singletonMap("labelKey", "labelValue")).endMetadata().withMaxUnavailable(2).build();
    Model model = new Model(Reconciliation.DUMMY_RECONCILIATION, kafka);
    ModelUtils.parsePodDisruptionBudgetTemplate(model, template);
    assertThat(model.templatePodDisruptionBudgetLabels, is(Collections.singletonMap("labelKey", "labelValue")));
    assertThat(model.templatePodDisruptionBudgetAnnotations, is(Collections.singletonMap("annoKey", "annoValue")));
    assertThat(model.templatePodDisruptionBudgetMaxUnavailable, is(2));
}
Also used : Kafka(io.strimzi.api.kafka.model.Kafka) KafkaBuilder(io.strimzi.api.kafka.model.KafkaBuilder) PodDisruptionBudgetTemplate(io.strimzi.api.kafka.model.template.PodDisruptionBudgetTemplate) PodDisruptionBudgetTemplateBuilder(io.strimzi.api.kafka.model.template.PodDisruptionBudgetTemplateBuilder) ParallelTest(io.strimzi.test.annotations.ParallelTest) Test(org.junit.jupiter.api.Test)

Example 2 with PodDisruptionBudgetTemplate

use of io.strimzi.api.kafka.model.template.PodDisruptionBudgetTemplate in project strimzi-kafka-operator by strimzi.

the class ModelUtilsTest method testParsePodDisruptionBudgetTemplate.

@Test
public void testParsePodDisruptionBudgetTemplate() {
    Kafka kafka = new KafkaBuilder().withNewMetadata().withName("my-cluster").withNamespace("my-namespace").endMetadata().build();
    PodDisruptionBudgetTemplate template = new PodDisruptionBudgetTemplateBuilder().withNewMetadata().withAnnotations(Collections.singletonMap("annoKey", "annoValue")).withLabels(Collections.singletonMap("labelKey", "labelValue")).endMetadata().withMaxUnavailable(2).build();
    Model model = new Model(Reconciliation.DUMMY_RECONCILIATION, kafka);
    ModelUtils.parsePodDisruptionBudgetTemplate(model, template);
    assertThat(model.templatePodDisruptionBudgetLabels, is(Collections.singletonMap("labelKey", "labelValue")));
    assertThat(model.templatePodDisruptionBudgetAnnotations, is(Collections.singletonMap("annoKey", "annoValue")));
    assertThat(model.templatePodDisruptionBudgetMaxUnavailable, is(2));
}
Also used : Kafka(io.strimzi.api.kafka.model.Kafka) KafkaBuilder(io.strimzi.api.kafka.model.KafkaBuilder) PodDisruptionBudgetTemplate(io.strimzi.api.kafka.model.template.PodDisruptionBudgetTemplate) PodDisruptionBudgetTemplateBuilder(io.strimzi.api.kafka.model.template.PodDisruptionBudgetTemplateBuilder) ParallelTest(io.strimzi.test.annotations.ParallelTest) Test(org.junit.jupiter.api.Test)

Aggregations

Kafka (io.strimzi.api.kafka.model.Kafka)2 KafkaBuilder (io.strimzi.api.kafka.model.KafkaBuilder)2 PodDisruptionBudgetTemplate (io.strimzi.api.kafka.model.template.PodDisruptionBudgetTemplate)2 PodDisruptionBudgetTemplateBuilder (io.strimzi.api.kafka.model.template.PodDisruptionBudgetTemplateBuilder)2 ParallelTest (io.strimzi.test.annotations.ParallelTest)2 Test (org.junit.jupiter.api.Test)2