Forum Discussion

sjakovac's avatar
Occasional Contributor
3 years ago

Assertion on empty Kafka response

I'm using Kafka API connection test step to consume messages from Kafka topic. I'd like my test step to fail if I do not recieve any messages during test step run.


Currently step finishes and I see log output "{date} {time} - 0 messages were recieved.", all my assertions are marked as unknown and whole test case is marked as passed. 


As per documentation "Assertions will be applied to every message that the Subscribe test step consumes from the topic.".  I would like for my test case to fail in such situations. I've tried making Script assertion to somehow check test step's status thru context object or directly inspect messageExchange object. It also does not work since that assertion is not run either.

Failing test case if any of test steps finishes with status UNKNOWN is not acceptable since I have some test steps for which it is fine to end with such status.


Thanks for help 🙂

1 Reply

  • sonya_m's avatar
    SmartBear Alumni (Retired)

    Hi sjakovac ! I spoke with the support team about this issue, and it looks like this might be a bug - they need to look deeper into this. Please open a support case. Thank you!

    The Community will greatly appreciate it if you share the final result of the investigation here, too.