2

I'm trying to unit test a spring cloud function based application that has to be run on AWS lambda taking an SQS event as trigger.

see this example : https://www.baeldung.com/spring-cloud-function The function runs fine on AWS lambda. But my unit test doesn't. Which class should I autowire ? I can neither create an instance of MyStringHandlers with new operator nor make it a component and autowire in my Test class in src/test ? I always end up with a nullpointerexception.

A working sample will be appreciated.

BugHunter
  • 61
  • 1
  • 7

0 Answers0