Skip to content

Commit 6086216

Browse files
committed
Migrate to APIGatewayV2HTTPEvent in struts and spark
1 parent ebd5acd commit 6086216

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

aws-serverless-java-container-spark/src/main/java/com/amazonaws/serverless/proxy/spark/SparkLambdaContainerHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,17 @@ public static SparkLambdaContainerHandler<AwsProxyRequest, AwsProxyResponse> get
119119
}
120120

121121
/**
122-
* Returns a new instance of an SparkLambdaContainerHandler initialized to work with <code>HttpApiV2ProxyRequest</code>
122+
* Returns a new instance of an SparkLambdaContainerHandler initialized to work with <code>APIGatewayV2HTTPEvent</code>
123123
* and <code>AwsProxyResponse</code> objects.
124124
*
125125
* @return a new instance of <code>SparkLambdaContainerHandler</code>
126126
*
127127
* @throws ContainerInitializationException Throws this exception if we fail to initialize the Spark container.
128128
* This could be caused by the introspection used to insert the library as the default embedded container
129129
*/
130-
public static SparkLambdaContainerHandler<HttpApiV2ProxyRequest, AwsProxyResponse> getHttpApiV2ProxyHandler()
130+
public static SparkLambdaContainerHandler<APIGatewayV2HTTPEvent, AwsProxyResponse> getHttpApiV2ProxyHandler()
131131
throws ContainerInitializationException {
132-
SparkLambdaContainerHandler<HttpApiV2ProxyRequest, AwsProxyResponse> newHandler = new SparkLambdaContainerHandler<>(HttpApiV2ProxyRequest.class,
132+
SparkLambdaContainerHandler<APIGatewayV2HTTPEvent, AwsProxyResponse> newHandler = new SparkLambdaContainerHandler<>(APIGatewayV2HTTPEvent.class,
133133
AwsProxyResponse.class,
134134
new AwsHttpApiV2HttpServletRequestReader(),
135135
new AwsProxyHttpServletResponseWriter(true),

aws-serverless-java-container-spark/src/test/java/com/amazonaws/serverless/proxy/spark/HelloWorldSparkStreamTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import com.amazonaws.serverless.proxy.model.AwsProxyRequest;
99
import com.amazonaws.serverless.proxy.model.AwsProxyResponse;
1010

11-
import com.amazonaws.serverless.proxy.model.HttpApiV2ProxyRequest;
1211
import com.amazonaws.services.lambda.runtime.Context;
1312
import org.junit.jupiter.api.AfterAll;
1413
import org.junit.jupiter.params.ParameterizedTest;
@@ -39,7 +38,7 @@ public class HelloWorldSparkStreamTest {
3938
private static final String COOKIE_PATH = "/";
4039

4140
private static SparkLambdaContainerHandler<AwsProxyRequest, AwsProxyResponse> handler;
42-
private static SparkLambdaContainerHandler<HttpApiV2ProxyRequest, AwsProxyResponse> httpApiHandler;
41+
private static SparkLambdaContainerHandler<APIGatewayV2HTTPEvent, AwsProxyResponse> httpApiHandler;
4342

4443
private String type;
4544

aws-serverless-java-container-struts/src/main/java/com/amazonaws/serverless/proxy/struts/StrutsLambdaContainerHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ public static StrutsLambdaContainerHandler<AwsProxyRequest, AwsProxyResponse> ge
7171
new AwsProxyExceptionHandler());
7272
}
7373

74-
public static StrutsLambdaContainerHandler<HttpApiV2ProxyRequest, AwsProxyResponse> getHttpApiV2ProxyHandler() {
74+
public static StrutsLambdaContainerHandler<APIGatewayV2HTTPEvent, AwsProxyResponse> getHttpApiV2ProxyHandler() {
7575
return new StrutsLambdaContainerHandler(
76-
HttpApiV2ProxyRequest.class,
76+
APIGatewayV2HTTPEvent.class,
7777
AwsProxyResponse.class,
7878
new AwsHttpApiV2HttpServletRequestReader(),
7979
new AwsProxyHttpServletResponseWriter(true),

aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts/StrutsAwsProxyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class StrutsAwsProxyTest extends StrutsRestTestCase<EchoAction> {
6262
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
6363
private final StrutsLambdaContainerHandler<AwsProxyRequest, AwsProxyResponse> handler = StrutsLambdaContainerHandler
6464
.getAwsProxyHandler();
65-
private final StrutsLambdaContainerHandler<HttpApiV2ProxyRequest, AwsProxyResponse> httpApiHandler = StrutsLambdaContainerHandler
65+
private final StrutsLambdaContainerHandler<APIGatewayV2HTTPEvent, AwsProxyResponse> httpApiHandler = StrutsLambdaContainerHandler
6666
.getHttpApiV2ProxyHandler();
6767
private final Context lambdaContext = new MockLambdaContext();
6868
private String type;

0 commit comments

Comments
 (0)