0

我有一个异步方法,想编写一个单元测试用例,我将方法粘贴到这里,任何人都可以帮助为此编写测试用例..

......

    public method1(string topic,string msg){
    ...
    client.publishWith().topic(topic).payload(msg.getBytes()).qos(MqttQos.EXACTLY_ONCE).send()
                    .whenComplete((mqtt3Publish, throwable) -> {
                        if (throwable != null) {
                             //Some normal Code
                        } else {
                           
                            //Some normal code
                        }
                    });
    
    ......

}
4

0 回答 0