In Eclipse, i created a new Amazon lambda function to a dynamodb
event. I didn't implement anything, the code is as the Amazon wizard creates the project.
When i run the test as junit, it returns:
com.fasterxml.jackson.databind.JsonMappingException: Conflicting setter definitions for property "eventName": com.amazonaws.services.dynamodbv2.model.Record#setEventName(1 params) vs com.amazonaws.services.dynamodbv2.model.Record#setEventName(1 params)
I try to solve this with @JsonIgnore
, but i get the same result.
Any suggestion?
I pass the junit test modifying the class of the object input from DynamodbEvent to Object at 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 at the lambda function I change the class to the input object too:
public class LambdaFunctionHandler implements RequestHandler<Object, Object> {
@Override
public Object handleRequest(Object input, Context context) {
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With