File tree 2 files changed +38
-0
lines changed
test-suite-aws-lambda-events-serde
src/test/java/io/micronaut/aws/lambda/events/serde/tests
2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ plugins {
4
4
}
5
5
dependencies {
6
6
testImplementation(projects.testSuiteAwsLambdaEvents)
7
+ testImplementation(projects.micronautFunctionAwsApiProxy)
7
8
testImplementation(mnSerde.micronaut.serde.jackson)
8
9
testImplementation(projects.micronautAwsLambdaEventsSerde)
9
10
}
Original file line number Diff line number Diff line change
1
+ package io .micronaut .aws .lambda .events .serde .tests ;
2
+
3
+ import com .amazonaws .services .lambda .runtime .events .APIGatewayProxyRequestEvent ;
4
+ import io .micronaut .function .aws .proxy .MockLambdaContext ;
5
+ import io .micronaut .function .aws .proxy .payload1 .ApiGatewayProxyRequestEventFunction ;
6
+ import io .micronaut .http .HttpMethod ;
7
+ import io .micronaut .http .HttpStatus ;
8
+ import org .junit .jupiter .api .AfterEach ;
9
+ import org .junit .jupiter .api .BeforeEach ;
10
+ import org .junit .jupiter .api .Test ;
11
+
12
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
13
+
14
+ class Issue2056Test {
15
+
16
+ private ApiGatewayProxyRequestEventFunction handler ;
17
+
18
+ @ BeforeEach
19
+ void setupSpec () {
20
+ handler = new ApiGatewayProxyRequestEventFunction ();
21
+ }
22
+
23
+ @ AfterEach
24
+ void cleanupSpec () throws Exception {
25
+ handler .close ();
26
+ }
27
+
28
+ @ Test
29
+ void testNotFoundEncoding () {
30
+ APIGatewayProxyRequestEvent request = new APIGatewayProxyRequestEvent ();
31
+ request .setPath ("/not_a_valid_url" );
32
+ request .setHttpMethod (HttpMethod .GET .toString ());
33
+ var response = handler .handleRequest (request , new MockLambdaContext ());
34
+
35
+ assertEquals (HttpStatus .NOT_FOUND .getCode (), response .getStatusCode ());
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments