Search in sources :

Example 6 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 {bool}")
public void klb_has_a_path_matching_value(String path, Boolean value) {
    KameletBinding res = klb();
    assertThat(res).isNotNull();
    assertThatJson(JacksonUtil.asJsonNode(res)).inPath(path).isBoolean().isEqualTo(value);
}
Also used : KameletBinding(org.bf2.cos.fleetshard.operator.camel.model.KameletBinding) And(io.cucumber.java.en.And)

Example 7 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 {string}")
public void klb_has_a_path_matching_value(String path, String value) {
    KameletBinding res = klb();
    assertThat(res).isNotNull();
    assertThatJson(JacksonUtil.asJsonNode(res)).inPath(path).isString().isEqualTo(ctx.resolvePlaceholders(value));
}
Also used : KameletBinding(org.bf2.cos.fleetshard.operator.camel.model.KameletBinding) And(io.cucumber.java.en.And)

Example 8 with KameletBinding

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

the class KameletBindingSteps method klb_annotation_contains.

@And("the klb has annotations containing:")
public void klb_annotation_contains(DataTable table) {
    KameletBinding res = klb();
    assertThat(res).isNotNull();
    assertThatDataTable(table, ctx::resolvePlaceholders).matches(res.getMetadata().getAnnotations());
}
Also used : KameletBinding(org.bf2.cos.fleetshard.operator.camel.model.KameletBinding) And(io.cucumber.java.en.And)

Example 9 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_containing_object.

@And("the klb has an array at path {string} containing:")
public void klb_has_a_path_containing_object(String path, DataTable elements) {
    KameletBinding res = klb();
    assertThat(res).isNotNull();
    assertThatJson(JacksonUtil.asJsonNode(res)).inPath(path).isArray().containsAll(elements.asList().stream().map(e -> ctx.resolvePlaceholders(e)).map(e -> Serialization.unmarshal(e, JsonNode.class)).collect(Collectors.toList()));
}
Also used : StepsSupport(org.bf2.cos.fleetshard.it.cucumber.support.StepsSupport) Then(io.cucumber.java.en.Then) When(io.cucumber.java.en.When) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) HashMap(java.util.HashMap) Collectors(java.util.stream.Collectors) KameletBinding(org.bf2.cos.fleetshard.operator.camel.model.KameletBinding) JsonAssertions.assertThatJson(net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson) CucumberAssertions.assertThatDataTable(org.bf2.cos.fleetshard.it.cucumber.assertions.CucumberAssertions.assertThatDataTable) ArrayList(java.util.ArrayList) Consumer(java.util.function.Consumer) And(io.cucumber.java.en.And) List(java.util.List) Condition(io.fabric8.kubernetes.api.model.Condition) ConditionBuilder(io.fabric8.kubernetes.api.model.ConditionBuilder) Serialization(io.fabric8.kubernetes.client.utils.Serialization) Map(java.util.Map) JacksonUtil(org.bf2.cos.fleetshard.support.json.JacksonUtil) JsonNode(com.fasterxml.jackson.databind.JsonNode) CamelConstants(org.bf2.cos.fleetshard.operator.camel.CamelConstants) DataTable(io.cucumber.datatable.DataTable) JsonNode(com.fasterxml.jackson.databind.JsonNode) KameletBinding(org.bf2.cos.fleetshard.operator.camel.model.KameletBinding) And(io.cucumber.java.en.And)

Example 10 with KameletBinding

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

the class KameletBindingSteps method klb_label_contains.

@And("the klb has labels containing:")
public void klb_label_contains(DataTable table) {
    KameletBinding res = klb();
    assertThat(res).isNotNull();
    assertThatDataTable(table, ctx::resolvePlaceholders).matches(res.getMetadata().getLabels());
}
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