diff --git a/examples/java/src/main/java/com/serverless/Handler.java b/examples/java/src/main/java/com/serverless/Handler.java index fa7403ca..d0270d6f 100644 --- a/examples/java/src/main/java/com/serverless/Handler.java +++ b/examples/java/src/main/java/com/serverless/Handler.java @@ -1,6 +1,5 @@ package com.serverless; -import java.util.Collections; import java.util.Map; import org.apache.logging.log4j.LogManager; @@ -9,18 +8,13 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -public class Handler implements RequestHandler, ApiGatewayResponse> { +public class Handler implements RequestHandler, String> { private static final Logger LOG = LogManager.getLogger(Handler.class); @Override - public ApiGatewayResponse handleRequest(Map input, Context context) { + public String handleRequest(Map input, Context context) { LOG.info("received: {}", input); - Response responseBody = new Response("Go Serverless v1.x! Your function executed successfully!", input); - return ApiGatewayResponse.builder() - .setStatusCode(200) - .setObjectBody(responseBody) - .setHeaders(Collections.singletonMap("X-Powered-By", "AWS Lambda & serverless")) - .build(); + return "ok"; } }