Search in sources :

Example 1 with KameletBinding

use of org.bf2.cos.fleetshard.operator.camel.model.KameletBinding in project cos-fleetshard by bf2fc6cc711aee1a0c2a.

the class KameletBindingSteps method klb_has_an_empty_object_at_path.

@And("the klb has an empty object at path {string}")
public void klb_has_an_empty_object_at_path(String path) {
    KameletBinding res = klb();
    assertThat(res).isNotNull();
    assertThatJson(JacksonUtil.asJsonNode(res)).inPath(path).isObject().isEmpty();
}
Also used : KameletBinding(org.bf2.cos.fleetshard.operator.camel.model.KameletBinding) And(io.cucumber.java.en.And)

Example 2 with KameletBinding

use of org.bf2.cos.fleetshard.operator.camel.model.KameletBinding in project cos-fleetshard by bf2fc6cc711aee1a0c2a.

the class KameletBindingSteps method klb_has_a_path_matching_object.

@And("the klb has an object at path {string} containing:")
public void klb_has_a_path_matching_object(String path, String content) {
    KameletBinding res = klb();
    assertThat(res).isNotNull();
    assertThatJson(JacksonUtil.asJsonNode(res)).inPath(path).isObject().containsValue(Serialization.unmarshal(content, JsonNode.class));
}
Also used : JsonNode(com.fasterxml.jackson.databind.JsonNode) KameletBinding(org.bf2.cos.fleetshard.operator.camel.model.KameletBinding) And(io.cucumber.java.en.And)

Example 3 with KameletBinding

use of org.bf2.cos.fleetshard.operator.camel.model.KameletBinding in project cos-fleetshard by bf2fc6cc711aee1a0c2a.

the class KameletBindingSteps method klb_has_a_path_matching_value.

@And("the klb has an entry at path {string} with value {int}")
public void klb_has_a_path_matching_value(String path, int value) {
    KameletBinding res = klb();
    assertThat(res).isNotNull();
    assertThatJson(JacksonUtil.asJsonNode(res)).inPath(path).isNumber().isEqualTo(value);
}
Also used : KameletBinding(org.bf2.cos.fleetshard.operator.camel.model.KameletBinding) And(io.cucumber.java.en.And)

Example 4 with KameletBinding

use of org.bf2.cos.fleetshard.operator.camel.model.KameletBinding in project cos-fleetshard by bf2fc6cc711aee1a0c2a.

the class KameletBindingSteps method klb_target_labels_contains.

@And("the klb has target-labels containing {string}")
public void klb_target_labels_contains(String value) {
    KameletBinding res = klb();
    assertThat(res).isNotNull();
    assertThat(res.getMetadata().getAnnotations()).isNotEmpty();
    assertThat(res.getMetadata().getAnnotations()).isNotEmpty();
    assertThat(res.getMetadata().getAnnotations()).containsKey(CamelConstants.TRAIT_CAMEL_APACHE_ORG_OWNER_TARGET_LABELS);
    String labels = res.getMetadata().getAnnotations().get(CamelConstants.TRAIT_CAMEL_APACHE_ORG_OWNER_TARGET_LABELS);
    assertThatJson(labels).isArray().contains(value);
}
Also used : KameletBinding(org.bf2.cos.fleetshard.operator.camel.model.KameletBinding) And(io.cucumber.java.en.And)

Example 5 with KameletBinding

use of org.bf2.cos.fleetshard.operator.camel.model.KameletBinding in project cos-fleetshard by bf2fc6cc711aee1a0c2a.

the class KameletBindingSteps method klb_annotations_does_not_contain.

@And("the klb annotations does not contain {string}")
public void klb_annotations_does_not_contain(String annotation) {
    KameletBinding res = klb();
    assertThat(res).isNotNull();
    assertThat(res.getMetadata().getAnnotations()).doesNotContainKey(annotation);
}
Also used : KameletBinding(org.bf2.cos.fleetshard.operator.camel.model.KameletBinding) And(io.cucumber.java.en.And)

Aggregations

KameletBinding (org.bf2.cos.fleetshard.operator.camel.model.KameletBinding)13 And (io.cucumber.java.en.And)11 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2 Secret (io.fabric8.kubernetes.api.model.Secret)2 List (java.util.List)2 Map (java.util.Map)2 Collectors (java.util.stream.Collectors)2 KameletEndpoint (org.bf2.cos.fleetshard.operator.camel.model.KameletEndpoint)2 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)1 DataTable (io.cucumber.datatable.DataTable)1 Then (io.cucumber.java.en.Then)1 When (io.cucumber.java.en.When)1 Condition (io.fabric8.kubernetes.api.model.Condition)1 ConditionBuilder (io.fabric8.kubernetes.api.model.ConditionBuilder)1 HasMetadata (io.fabric8.kubernetes.api.model.HasMetadata)1 ObjectMeta (io.fabric8.kubernetes.api.model.ObjectMeta)1 ObjectMetaBuilder (io.fabric8.kubernetes.api.model.ObjectMetaBuilder)1 SecretBuilder (io.fabric8.kubernetes.api.model.SecretBuilder)1 KubernetesClient (io.fabric8.kubernetes.client.KubernetesClient)1