Skip to content

Commit a5a0168

Browse files
authored
feat(apigatewayv2-integrations): WebSocketMockIntegration props (#30622)
### Issue # (if applicable) None ### Reason for this change Unlike the other integrations, `WebSocketMockIntegration` did not have a props interface, and was missing a few properties. This PR does not include integration responses, they are already being implemented in #29661 ### Description of changes * Added `requestTemplates` and `templateSelectionExpression` to the newly created `WebSocketMockIntegrationProps` ### Description of how you validated changes Unit and integration tests were updated ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 3fbc785 commit a5a0168

File tree

12 files changed

+381
-65
lines changed

12 files changed

+381
-65
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-integrations/test/websocket/integ.mock.js.snapshot/apigatewayv2mockintegrationintegtestDefaultTestDeployAssert3D8FA778.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-integrations/test/websocket/integ.mock.js.snapshot/apigatewayv2mockintegrationintegtestDefaultTestDeployAssert3D8FA778.template.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-integrations/test/websocket/integ.mock.js.snapshot/cdk.out

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-integrations/test/websocket/integ.mock.js.snapshot/integ-mock-websocket-integration.assets.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-integrations/test/websocket/integ.mock.js.snapshot/integ-mock-websocket-integration.template.json

+24-7
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"ApiId": {
2525
"Ref": "mywsapi32E6CE11"
2626
},
27-
"RouteKey": "$default",
2827
"AuthorizationType": "NONE",
28+
"RouteKey": "$default",
2929
"Target": {
3030
"Fn::Join": [
3131
"",
@@ -39,14 +39,18 @@
3939
}
4040
}
4141
},
42-
"mywsapisendmessageRouteSendMessageIntegrationD29E12F9": {
42+
"mywsapisendmessageRouteDefaultIntegration702159AD": {
4343
"Type": "AWS::ApiGatewayV2::Integration",
4444
"Properties": {
4545
"ApiId": {
4646
"Ref": "mywsapi32E6CE11"
4747
},
4848
"IntegrationType": "MOCK",
49-
"IntegrationUri": ""
49+
"IntegrationUri": "",
50+
"RequestTemplates": {
51+
"application/json": "{\"statusCode\":200}"
52+
},
53+
"TemplateSelectionExpression": "\\$default"
5054
}
5155
},
5256
"mywsapisendmessageRouteAE873328": {
@@ -55,29 +59,42 @@
5559
"ApiId": {
5660
"Ref": "mywsapi32E6CE11"
5761
},
58-
"RouteKey": "sendmessage",
5962
"AuthorizationType": "NONE",
63+
"RouteKey": "sendmessage",
64+
"RouteResponseSelectionExpression": "$default",
6065
"Target": {
6166
"Fn::Join": [
6267
"",
6368
[
6469
"integrations/",
6570
{
66-
"Ref": "mywsapisendmessageRouteSendMessageIntegrationD29E12F9"
71+
"Ref": "mywsapisendmessageRouteDefaultIntegration702159AD"
6772
}
6873
]
6974
]
7075
}
7176
}
7277
},
78+
"mywsapisendmessageRouteResponse2ED167D2": {
79+
"Type": "AWS::ApiGatewayV2::RouteResponse",
80+
"Properties": {
81+
"ApiId": {
82+
"Ref": "mywsapi32E6CE11"
83+
},
84+
"RouteId": {
85+
"Ref": "mywsapisendmessageRouteAE873328"
86+
},
87+
"RouteResponseKey": "$default"
88+
}
89+
},
7390
"mystage114C35EC": {
7491
"Type": "AWS::ApiGatewayV2::Stage",
7592
"Properties": {
7693
"ApiId": {
7794
"Ref": "mywsapi32E6CE11"
7895
},
79-
"StageName": "dev",
80-
"AutoDeploy": true
96+
"AutoDeploy": true,
97+
"StageName": "dev"
8198
}
8299
}
83100
},

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-integrations/test/websocket/integ.mock.js.snapshot/integ.json

+5-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-integrations/test/websocket/integ.mock.js.snapshot/manifest.json

+74-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)