Skip to content

Commit e621928

Browse files
committed
Refactor Json texture using text block and add checkstyle suppressions
Signed-off-by: Hyunwoo Jung <[email protected]>
1 parent bca2e81 commit e621928

File tree

6 files changed

+1001
-407
lines changed

6 files changed

+1001
-407
lines changed

spring-cloud-function-adapters/spring-cloud-function-adapter-aws/src/test/java/org/springframework/cloud/function/adapter/aws/CustomRuntimeEventLoopTest.java

Lines changed: 84 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -40,43 +40,90 @@
4040
*/
4141
public class CustomRuntimeEventLoopTest {
4242

43-
private String API_EVENT = "{\n" + " \"version\": \"1.0\",\n" + " \"resource\": \"$default\",\n"
44-
+ " \"path\": \"/question\",\n" + " \"httpMethod\": \"POST\",\n" + " \"headers\": {\n"
45-
+ " \"Content-Length\": \"40\",\n" + " \"Content-Type\": \"application/json\",\n"
46-
+ " \"Host\": \"emcdxu5ijj.execute-api.us-east-2.amazonaws.com\",\n"
47-
+ " \"User-Agent\": \"curl/7.88.1\",\n"
48-
+ " \"X-Amzn-Trace-Id\": \"Root=1-64ad9787-4c89d5af7607eb9e522e01d5\",\n"
49-
+ " \"X-Forwarded-For\": \"109.210.252.44\",\n" + " \"X-Forwarded-Port\": \"443\",\n"
50-
+ " \"X-Forwarded-Proto\": \"https\",\n" + " \"accept\": \"*/*\"\n" + " },\n"
51-
+ " \"multiValueHeaders\": {\n" + " \"Content-Length\": [\n" + " \"40\"\n"
52-
+ " ],\n" + " \"Content-Type\": [\n" + " \"application/json\"\n" + " ],\n"
53-
+ " \"Host\": [\n" + " \"emcdxu5ijj.execute-api.us-east-2.amazonaws.com\"\n"
54-
+ " ],\n" + " \"User-Agent\": [\n" + " \"curl/7.88.1\"\n" + " ],\n"
55-
+ " \"X-Amzn-Trace-Id\": [\n" + " \"Root=1-64ad9787-4c89d5af7607eb9e522e01d5\"\n"
56-
+ " ],\n" + " \"X-Forwarded-For\": [\n" + " \"109.210.252.44\"\n" + " ],\n"
57-
+ " \"X-Forwarded-Port\": [\n" + " \"443\"\n" + " ],\n"
58-
+ " \"X-Forwarded-Proto\": [\n" + " \"https\"\n" + " ],\n"
59-
+ " \"accept\": [\n" + " \"*/*\"\n" + " ]\n" + " },\n"
60-
+ " \"queryStringParameters\": null,\n" + " \"multiValueQueryStringParameters\": null,\n"
61-
+ " \"requestContext\": {\n" + " \"accountId\": \"313369169943\",\n"
62-
+ " \"apiId\": \"emcdxu5ijj\",\n"
63-
+ " \"domainName\": \"emcdxu5ijj.execute-api.us-east-2.amazonaws.com\",\n"
64-
+ " \"domainPrefix\": \"emcdxu5ijj\",\n" + " \"extendedRequestId\": \"H6SdPgXtiYcEP1w=\",\n"
65-
+ " \"httpMethod\": \"POST\",\n" + " \"identity\": {\n" + " \"accessKey\": null,\n"
66-
+ " \"accountId\": null,\n" + " \"caller\": null,\n"
67-
+ " \"cognitoAmr\": null,\n" + " \"cognitoAuthenticationProvider\": null,\n"
68-
+ " \"cognitoAuthenticationType\": null,\n" + " \"cognitoIdentityId\": null,\n"
69-
+ " \"cognitoIdentityPoolId\": null,\n" + " \"principalOrgId\": null,\n"
70-
+ " \"sourceIp\": \"109.210.252.44\",\n" + " \"user\": null,\n"
71-
+ " \"userAgent\": \"curl/7.88.1\",\n" + " \"userArn\": null\n" + " },\n"
72-
+ " \"path\": \"/question\",\n" + " \"protocol\": \"HTTP/1.1\",\n"
73-
+ " \"requestId\": \"H6SdPgXtiYcEP1w=\",\n"
74-
+ " \"requestTime\": \"11/Jul/2023:17:55:19 +0000\",\n"
75-
+ " \"requestTimeEpoch\": 1689098119662,\n" + " \"resourceId\": \"$default\",\n"
76-
+ " \"resourcePath\": \"$default\",\n" + " \"stage\": \"$default\"\n" + " },\n"
77-
+ " \"pathParameters\": null,\n" + " \"stageVariables\": null,\n"
78-
+ " \"body\": \"[{\\\"latitude\\\": 41.34, \\\"longitude\\\": 2.78},{\\\"latitude\\\": 43.24, \\\"longitude\\\": 3.78}]\",\n"
79-
+ " \"isBase64Encoded\": false\n" + "}";
43+
private String API_EVENT = """
44+
{
45+
"version": "1.0",
46+
"resource": "$default",
47+
"path": "/question",
48+
"httpMethod": "POST",
49+
"headers": {
50+
"Content-Length": "40",
51+
"Content-Type": "application/json",
52+
"Host": "emcdxu5ijj.execute-api.us-east-2.amazonaws.com",
53+
"User-Agent": "curl/7.88.1",
54+
"X-Amzn-Trace-Id": "Root=1-64ad9787-4c89d5af7607eb9e522e01d5",
55+
"X-Forwarded-For": "109.210.252.44",
56+
"X-Forwarded-Port": "443",
57+
"X-Forwarded-Proto": "https",
58+
"accept": "*/*"
59+
},
60+
"multiValueHeaders": {
61+
"Content-Length": [
62+
"40"
63+
],
64+
"Content-Type": [
65+
"application/json"
66+
],
67+
"Host": [
68+
"emcdxu5ijj.execute-api.us-east-2.amazonaws.com"
69+
],
70+
"User-Agent": [
71+
"curl/7.88.1"
72+
],
73+
"X-Amzn-Trace-Id": [
74+
"Root=1-64ad9787-4c89d5af7607eb9e522e01d5"
75+
],
76+
"X-Forwarded-For": [
77+
"109.210.252.44"
78+
],
79+
"X-Forwarded-Port": [
80+
"443"
81+
],
82+
"X-Forwarded-Proto": [
83+
"https"
84+
],
85+
"accept": [
86+
"*/*"
87+
]
88+
},
89+
"queryStringParameters": null,
90+
"multiValueQueryStringParameters": null,
91+
"requestContext": {
92+
"accountId": "313369169943",
93+
"apiId": "emcdxu5ijj",
94+
"domainName": "emcdxu5ijj.execute-api.us-east-2.amazonaws.com",
95+
"domainPrefix": "emcdxu5ijj",
96+
"extendedRequestId": "H6SdPgXtiYcEP1w=",
97+
"httpMethod": "POST",
98+
"identity": {
99+
"accessKey": null,
100+
"accountId": null,
101+
"caller": null,
102+
"cognitoAmr": null,
103+
"cognitoAuthenticationProvider": null,
104+
"cognitoAuthenticationType": null,
105+
"cognitoIdentityId": null,
106+
"cognitoIdentityPoolId": null,
107+
"principalOrgId": null,
108+
"sourceIp": "109.210.252.44",
109+
"user": null,
110+
"userAgent": "curl/7.88.1",
111+
"userArn": null
112+
},
113+
"path": "/question",
114+
"protocol": "HTTP/1.1",
115+
"requestId": "H6SdPgXtiYcEP1w=",
116+
"requestTime": "11/Jul/2023:17:55:19 +0000",
117+
"requestTimeEpoch": 1689098119662,
118+
"resourceId": "$default",
119+
"resourcePath": "$default",
120+
"stage": "$default"
121+
},
122+
"pathParameters": null,
123+
"stageVariables": null,
124+
"body": "[{\\"latitude\\": 41.34, \\"longitude\\": 2.78},{\\"latitude\\": 43.24, \\"longitude\\": 3.78}]",
125+
"isBase64Encoded": false
126+
}""";
80127

81128
@Test
82129
public void testDefaultFunctionLookup() throws Exception {

0 commit comments

Comments
 (0)