Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validator should support token replacement and "dig replace" #666

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
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"
}
}
]
Loading