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));
}
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));
}
Aggregations