Quantcast
Channel: Active questions tagged consumer - Stack Overflow
Viewing all articles
Browse latest Browse all 87

Junit for Consumer class returning lambda

$
0
0

I am writing junit test case for below for consumer class which has below method.

@Bean @Transactional public Consumer<Message<String>> response() {      return message -> {         Acknowledgment ack = message.getHeaders().get(Ack, Acknowledgment.class);        helper(message);         log.info("hello");         ack.acknowlege();     }

I am trying to go inside the lambda function through test method but able to proceed further. I tried to write the test as below:

@Testpublic void testHelper() {    Message<String> message = MessageBuilder.withPayload("Hello").build();    consumer.response();}

Viewing all articles
Browse latest Browse all 87

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>