Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.jsmart.zerocode.integration.tests.kafka.validation_dig_test;

import org.jsmart.zerocode.core.domain.Scenario;
import org.jsmart.zerocode.core.domain.TargetEnv;
import org.jsmart.zerocode.core.runner.ZeroCodeUnitRunner;
import org.junit.Test;
import org.junit.runner.RunWith;


@TargetEnv("kafka_servers/kafka_test_server.properties")
@RunWith(ZeroCodeUnitRunner.class)
public class KafkaValidatorDigTest {

@Test
@Scenario("kafka/consume/validator_dig_test/test_kafka_produce_consume_validator_dig_replace_tokens.json")
public void test_validator_dig() {
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"key": "${$.timestamp_step.response}",
"value": {
"test": "1"
}
},
{
"key": "0",
"value": {
"test": "2"
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"scenarioName": "Parameterized kafka test with validator and tokens to dig in validator value",
"steps": [
{
"name": "timestamp_step",
"url": "java.lang.System",
"method": "currentTimeMillis",
"assertions": "$NOT.NULL"
},
{
"name": "produce_step",
"url": "kafka-topic:kafka_dig_test_topic",
"operation": "produce",
"request": {
"recordType": "JSON",
"records": "${0}"
},
"assertions": {
"status" : "Ok"
}
},
{
"name": "consume_step",
"url": "kafka-topic:kafka_dig_test_topic",
"operation": "consume",
"request": {
"consumerLocalConfigs": {
"recordType": "JSON"
}
},
"validators": [
{
"field": "$.records[?(@.key == '${$.timestamp_step.response}')]",
"value": "${1}"
}
]
}
],
"parameterized": {
"csvSource":[
"${JSON.FILE:kafka/consume/validator_dig_test/produce_records.json}, ${JSON.FILE:kafka/consume/validator_dig_test/validation_value.json}"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
{
"key": "${$.timestamp_step.response}",
"value": {
"test": "1"
}
}
]