Decathlon / tzatziki

Decathlon library to ease and promote Test Driven Development of Java microservices!
Apache License 2.0
58 stars 27 forks source link

assert multiple message on kafka message using "within" doesn't work #336

Open vbrune14 opened 1 day ago

vbrune14 commented 1 day ago

if you want to assert that X (x>1) messages are received in a kafka topic within XXXXXms, you will in most cases receive a false

Indeed, the "within" parameter will do a check every 100ms, so every 100ms it will poll messages, if one message is received, this "alone" message will be compared with a list (=> false) and immediately forget, then others polls will be done, each time comparing "alone" message with list and forget the "alone" message The only case of success is if all message arrived in the same poll....

fix will consist in keeping in memory all the previous polled message, and compare the full list with the expected list

/!\ don't forget compliance with assertion on unique message , comparaison with "alone" message is ok