How to test ListenableFuture Callbacks in spock
问题 I asked a question a few days ago regarding stubbing the future response from the kafka.send() method. this was answered and explained correctly by @kriegaex here Though I faced another issue, on how can i test the onSuccess and onFailure callbacks of this future response. here's the code under testing. import org.springframework.kafka.core.KafkaTemplate; import org.springframework.kafka.support.SendResult; import org.springframework.util.concurrent.ListenableFuture; import org