Open PoorviIjantkar opened 8 months ago
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 ") });`
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 ") });`