Search in sources :

Example 86 with KafkaConnector

use of io.strimzi.api.kafka.model.KafkaConnector in project cos-fleetshard by bf2fc6cc711aee1a0c2a.

the class KafkaConnectorSteps method untilKctr.

private void untilKctr(Consumer<KafkaConnector> predicate) {
    awaiter.untilAsserted(() -> {
        KafkaConnector res = kctr();
        assertThat(res).isNotNull();
        assertThat(res).satisfies(predicate);
    });
}
Also used : KafkaConnector(io.strimzi.api.kafka.model.KafkaConnector)

Example 87 with KafkaConnector

use of io.strimzi.api.kafka.model.KafkaConnector in project cos-fleetshard by bf2fc6cc711aee1a0c2a.

the class KafkaConnectorSteps method kctr_has_a_path_matching_value.

@And("the kctr has an entry at path {string} with value {int}")
public void kctr_has_a_path_matching_value(String path, int value) {
    KafkaConnector res = kctr();
    assertThat(res).isNotNull();
    assertThatJson(JacksonUtil.asJsonNode(res)).inPath(path).isNumber().satisfies(bd -> assertThat(bd.intValue()).isEqualTo(value));
}
Also used : KafkaConnector(io.strimzi.api.kafka.model.KafkaConnector) And(io.cucumber.java.en.And)

Example 88 with KafkaConnector

use of io.strimzi.api.kafka.model.KafkaConnector in project cos-fleetshard by bf2fc6cc711aee1a0c2a.

the class KafkaConnectorSteps method kctr_has_a_path_matching_object.

@And("the kctr has an object at path {string} containing:")
public void kctr_has_a_path_matching_object(String path, String content) {
    KafkaConnector res = kctr();
    assertThat(res).isNotNull();
    assertThatJson(JacksonUtil.asJsonNode(res)).inPath(path).isObject().containsValue(Serialization.unmarshal(content, JsonNode.class));
}
Also used : KafkaConnector(io.strimzi.api.kafka.model.KafkaConnector) JsonNode(com.fasterxml.jackson.databind.JsonNode) And(io.cucumber.java.en.And)

Example 89 with KafkaConnector

use of io.strimzi.api.kafka.model.KafkaConnector in project cos-fleetshard by bf2fc6cc711aee1a0c2a.

the class KafkaConnectorSteps method kctr_annotation_contains.

@And("the kctr has annotations containing:")
public void kctr_annotation_contains(DataTable table) {
    KafkaConnector res = kctr();
    assertThat(res).isNotNull();
    assertThatDataTable(table, ctx::resolvePlaceholders).matches(res.getMetadata().getAnnotations());
}
Also used : KafkaConnector(io.strimzi.api.kafka.model.KafkaConnector) And(io.cucumber.java.en.And)

Example 90 with KafkaConnector

use of io.strimzi.api.kafka.model.KafkaConnector in project cos-fleetshard by bf2fc6cc711aee1a0c2a.

the class KafkaConnectorSteps method kctr_has_a_path_matching_value.

@And("the kctr has an entry at path {string} with value {string}")
public void kctr_has_a_path_matching_value(String path, String value) {
    KafkaConnector res = kctr();
    assertThat(res).isNotNull();
    assertThatJson(JacksonUtil.asJsonNode(res)).inPath(path).isString().isEqualTo(ctx.resolvePlaceholders(value));
}
Also used : KafkaConnector(io.strimzi.api.kafka.model.KafkaConnector) And(io.cucumber.java.en.And)

Aggregations

KafkaConnector (io.strimzi.api.kafka.model.KafkaConnector)113 Test (org.junit.jupiter.api.Test)82 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)82 KafkaConnect (io.strimzi.api.kafka.model.KafkaConnect)79 KafkaConnectBuilder (io.strimzi.api.kafka.model.KafkaConnectBuilder)65 KafkaConnectorList (io.strimzi.api.kafka.KafkaConnectorList)60 KubernetesClient (io.fabric8.kubernetes.client.KubernetesClient)58 PlatformFeaturesAvailability (io.strimzi.operator.PlatformFeaturesAvailability)58 ResourceOperatorSupplier (io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier)58 Reconciliation (io.strimzi.operator.common.Reconciliation)58 Future (io.vertx.core.Future)58 Vertx (io.vertx.core.Vertx)58 List (java.util.List)57 KafkaConnectResources (io.strimzi.api.kafka.model.KafkaConnectResources)56 KafkaConnectCluster (io.strimzi.operator.cluster.model.KafkaConnectCluster)56 Annotations (io.strimzi.operator.common.Annotations)56 KubernetesVersion (io.strimzi.operator.KubernetesVersion)54 KafkaVersionTestUtils (io.strimzi.operator.cluster.KafkaVersionTestUtils)54 CrdOperator (io.strimzi.operator.common.operator.resource.CrdOperator)54 Checkpoint (io.vertx.junit5.Checkpoint)54