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();}