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