Search in sources :

Example 16 with And

use of io.cucumber.java.en.And in project cos-fleetshard by bf2fc6cc711aee1a0c2a.

the class KameletBindingSecretSteps method klb_has_a_path_matching_value.

@And("the klb secret has an entry at path {string} with value {int}")
public void klb_has_a_path_matching_value(String path, int value) {
    Secret secret = secret();
    assertThat(secret).isNotNull();
    assertThatJson(JacksonUtil.asJsonNode(secret)).inPath(path).isNumber().isEqualTo(value);
}
Also used : Secret(io.fabric8.kubernetes.api.model.Secret) And(io.cucumber.java.en.And)

Example 17 with And

use of io.cucumber.java.en.And 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 18 with And

use of io.cucumber.java.en.And 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) 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 19 with And

use of io.cucumber.java.en.And 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 20 with And

use of io.cucumber.java.en.And 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

And (io.cucumber.java.en.And)33 KafkaConnect (io.strimzi.api.kafka.model.KafkaConnect)8 KafkaConnector (io.strimzi.api.kafka.model.KafkaConnector)8 KameletBinding (org.bf2.cos.fleetshard.operator.camel.model.KameletBinding)8 JsonNode (com.fasterxml.jackson.databind.JsonNode)6 Secret (io.fabric8.kubernetes.api.model.Secret)6 DataTable (io.cucumber.datatable.DataTable)3 Then (io.cucumber.java.en.Then)3 When (io.cucumber.java.en.When)3 Serialization (io.fabric8.kubernetes.client.utils.Serialization)3 Consumer (java.util.function.Consumer)3 Collectors (java.util.stream.Collectors)3 JsonAssertions.assertThatJson (net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson)3 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)3 CucumberAssertions.assertThatDataTable (org.bf2.cos.fleetshard.it.cucumber.assertions.CucumberAssertions.assertThatDataTable)3 StepsSupport (org.bf2.cos.fleetshard.it.cucumber.support.StepsSupport)3 JacksonUtil (org.bf2.cos.fleetshard.support.json.JacksonUtil)3 FailureException (com.github.noraui.exception.FailureException)2 Result (com.github.noraui.exception.Result)2 Et (io.cucumber.java.fr.Et)2