Search in sources :

Example 1 with DeploymentTemplateBuilder

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

the class ModelUtilsTest method testParseDeploymentTemplate.

@Test
public void testParseDeploymentTemplate() {
    KafkaConnect connect = new KafkaConnectBuilder().withNewMetadata().withName("my-connect-cluster").withNamespace("my-namespace").endMetadata().build();
    DeploymentTemplate template = new DeploymentTemplateBuilder().withNewMetadata().withAnnotations(Collections.singletonMap("annoKey", "annoValue")).withLabels(Collections.singletonMap("labelKey", "labelValue")).endMetadata().withDeploymentStrategy(DeploymentStrategy.RECREATE).build();
    Model model = new Model(Reconciliation.DUMMY_RECONCILIATION, connect);
    ModelUtils.parseDeploymentTemplate(model, template);
    assertThat(model.templateDeploymentLabels, is(Collections.singletonMap("labelKey", "labelValue")));
    assertThat(model.templateDeploymentAnnotations, is(Collections.singletonMap("annoKey", "annoValue")));
    assertThat(model.templateDeploymentStrategy, is(DeploymentStrategy.RECREATE));
}
Also used : KafkaConnectBuilder(io.strimzi.api.kafka.model.KafkaConnectBuilder) DeploymentTemplateBuilder(io.strimzi.api.kafka.model.template.DeploymentTemplateBuilder) KafkaConnect(io.strimzi.api.kafka.model.KafkaConnect) DeploymentTemplate(io.strimzi.api.kafka.model.template.DeploymentTemplate) ParallelTest(io.strimzi.test.annotations.ParallelTest) Test(org.junit.jupiter.api.Test)

Example 2 with DeploymentTemplateBuilder

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

the class ModelUtilsTest method testParseDeploymentTemplate.

@Test
public void testParseDeploymentTemplate() {
    KafkaConnect connect = new KafkaConnectBuilder().withNewMetadata().withName("my-connect-cluster").withNamespace("my-namespace").endMetadata().build();
    DeploymentTemplate template = new DeploymentTemplateBuilder().withNewMetadata().withAnnotations(Collections.singletonMap("annoKey", "annoValue")).withLabels(Collections.singletonMap("labelKey", "labelValue")).endMetadata().withDeploymentStrategy(DeploymentStrategy.RECREATE).build();
    Model model = new Model(Reconciliation.DUMMY_RECONCILIATION, connect);
    ModelUtils.parseDeploymentTemplate(model, template);
    assertThat(model.templateDeploymentLabels, is(Collections.singletonMap("labelKey", "labelValue")));
    assertThat(model.templateDeploymentAnnotations, is(Collections.singletonMap("annoKey", "annoValue")));
    assertThat(model.templateDeploymentStrategy, is(DeploymentStrategy.RECREATE));
}
Also used : KafkaConnectBuilder(io.strimzi.api.kafka.model.KafkaConnectBuilder) DeploymentTemplateBuilder(io.strimzi.api.kafka.model.template.DeploymentTemplateBuilder) KafkaConnect(io.strimzi.api.kafka.model.KafkaConnect) DeploymentTemplate(io.strimzi.api.kafka.model.template.DeploymentTemplate) ParallelTest(io.strimzi.test.annotations.ParallelTest) Test(org.junit.jupiter.api.Test)

Aggregations

KafkaConnect (io.strimzi.api.kafka.model.KafkaConnect)2 KafkaConnectBuilder (io.strimzi.api.kafka.model.KafkaConnectBuilder)2 DeploymentTemplate (io.strimzi.api.kafka.model.template.DeploymentTemplate)2 DeploymentTemplateBuilder (io.strimzi.api.kafka.model.template.DeploymentTemplateBuilder)2 ParallelTest (io.strimzi.test.annotations.ParallelTest)2 Test (org.junit.jupiter.api.Test)2