Asset a specific message when multiple messages flowing through the brokers or topics
See original GitHub issueCreated from #220
2. When testing in real environment, there will be multiple messages flowing through the brokers/topics. How can zerocode validate/asset a specific response? Ans: Use Json Path to look for a perticular message or a record key or value. Very easy! e.g.
When you have consume multiple records from a topic, that means you receive an array of records as the response. Then you can assert this way explained in the readme-file.
Where is this JSON path is applied ? In JUNIT or within Zerocode JSON config ?
For example, my test below keeps on failing. In the log, instead of just consuming the messages with the ids I have specified below. It consumes the whole array of 10 messages.
{
"scenarioName": "consume a JSON message with id_5 & id_9 out of 10 messages produced on topic_A",
"steps": [
{
"name": "consume_step",
"url": "kafka-topic:topic_A",
"operation": "consume",
"request": {
"consumerLocalConfigs": {
"recordType": "JSON",
"commitSync": true,
"showRecordsConsumed": true,
"maxNoOfRetryPollsOrTimeouts": 3
}
},
"assertions": {
"records": [
{
"key": "id_5",
"value": {
"TEST": "Test Val0"
}
},
{
"key": "id_9",
"value": {
"TEST": "Test Val9"
}
}
]
}
}
]
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
What Is a Message Broker? How It Helps You Scale for Success
Message brokers act as a bridge between different message queues (MQs) and enable distributed processing of messages across multiple cluster ...
Read more >Apache Kafka Queue 101: Messaging Made Easy - Learn | Hevo
Messages are saved as topics in each broker. Topics are separated into divisions, and each message is assigned to one of these partitions....
Read more >Message routing, filtering, ordering - Solace vs. Kafka
PubSub+ message brokers match messages against subscriptions in real-time as messages enter the broker and queue them to consumers without involvement from the ......
Read more >Lessons Learned From Running Kafka at Datadog
Kafka stores data across partitions in each topic, and each partition has a leader and zero or more followers that fetch and replicate...
Read more >What is MQTT and How Does it Work? - TechTarget
The broker pushes information to subscribers. The broker's job is to push information out to clients that have subscribed to a topic. Most...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@authorjapps , very grateful for your responses and pointers. Will have keep you posted on the blog! 😃
That sounds cool. 👍
For Oauth2 one of our contributor(and user) has shared a very short and precise blog in the DZone Security Zone. I am tagging him(@santhoshTpixler ) here in case you need more details on this.
For Corporate Proxy configuration, you can follow the README section here
SAML/JWT are very straight forward - working examples are here - HelloWorld repo
If tokens are dynamic, it’s still easy to inject them into header in runtime.
If you use OpenAM or RedHat SSO or Simple Basic Auth
Zerocode’s Http Client supports Http and Https connections anyways.