I pass the junit test by changing the class of the input object from DynamodbEvent to Object in the test method:
public class LambdaFunctionHandlerTest { //private static DynamodbEvent input; private static Object input; @BeforeClass public static void createInput() throws IOException { //input = TestUtils.parse("dynamodb-update-event.json", DynamodbEvent.class); input = TestUtils.parse("dynamodb-update-event.json", Object.class); }
And with the lambda function, I also change the class to the input object:
public class LambdaFunctionHandler implements RequestHandler<Object, Object> { @Override public Object handleRequest(Object input, Context context) {
source share