How to simulate an exception for compatable future ofpublish.send.whenComplete() in the below code in junit5
PoorviIjantkar opened this issue · 0 comments
PoorviIjantkar commented
How to simulate an exception for compatable future ofpublish.send.whenComplete() in the below code in junit5 for the below code
I am writing an integration test.How to mock an exception for whenComplete in the below code:
mqtt5Client.publishWith().topic(topicName)
.payload(messagePayLoad)
.qos(mqttQos)
.retain(isRetainedMessage)
.send().whenComplete((connAck, exception) -> {
if (exception != null) {
log.error("Failed publishing the event ")
} else
log.info("Successfully published the event ")
});`