-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
Hello,
I'm trying to assert that my topic contains a tombstone event.
Message produced by producer :
key: "randomKey"
value: null
With this code
kafkaTemplate.send(topicName, keyGenerator(itemId.toString(), warehouseGln), null);
In the_topic_contains method
public void the_topic_contains(Guard guard, boolean fromBeginning, String topicValue, Comparison comparison, String name, String content) {
...
Map<String, String> headers = (Map)Stream.of(record.headers().toArray()).collect(Collectors.toMap(Header::key, (header) -> new String(header.value())));
Map<String, Object> value = (Map)Mapper.read(record.value().toString()); <----- NPE here
String messageKey = record.key() != null ? String.valueOf(record.key()) : "";
...
});
}
Stacktrace
java.lang.NullPointerException: Cannot invoke "Object.toString()" because the return value of "org.apache.kafka.clients.consumer.ConsumerRecord.value()" is null
at com.decathlon.tzatziki.steps.KafkaSteps.lambda$the_topic_contains$20(KafkaSteps.java:304)
If I'm using library correctly I think it's an issue.
Don't hesitate to give me the correct way to achieve this assertion if not.
Thanks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers