Skip to content

Commit

Permalink
revert: extra Mock props
Browse files Browse the repository at this point in the history
  • Loading branch information
nmussy committed Jun 22, 2024
1 parent 31302b8 commit 279bac0
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 39 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@
"Ref": "mywsapi32E6CE11"
},
"IntegrationType": "MOCK",
"IntegrationUri": "",
"RequestTemplates": {
"application/json": "{\"statusCode\":200}"
}
"IntegrationUri": ""
}
},
"mywsapisendmessageRouteintegmockwebsocketintegrationmywsapisendmessageRouteDefaultIntegrationA39F8D24defaultIntegrationResponse72380ED8": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const stage = new WebSocketStage(stack, 'mystage', {

webSocketApi.addRoute('sendmessage', {
integration: new WebSocketMockIntegration('DefaultIntegration', {
requestTemplates: { 'application/json': JSON.stringify({ statusCode: 200 }) },
responses: [
{
responseKey: WebSocketIntegrationResponseKey.default,
Expand All @@ -40,4 +39,4 @@ new CfnOutput(stack, 'ApiEndpoint', { value: stage.url });

new IntegTest(app, 'apigatewayv2-mock-integration-integ-test', {
testCases: [stack],
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,6 @@ import {
* Props for Mock type integration for a WebSocket Api.
*/
export interface WebSocketMockIntegrationProps {
/**
* A map of Apache Velocity templates that are applied on the request
* payload.
*
* ```
* { "application/json": "{ \"statusCode\": 200 }" }
* ```
*
* @default - No request template provided to the integration.
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-mapping-template-reference.html
*/
readonly requestTemplates?: { [contentType: string]: string };

/**
* The template selection expression for the integration.
*
* @default - No template selection expression provided.
*/
readonly templateSelectionExpression?: string;

/**
* Integration responses configuration
*
Expand All @@ -56,8 +36,6 @@ export class WebSocketMockIntegration extends CustomResponseWebSocketRoute {
return {
type: WebSocketIntegrationType.MOCK,
uri: '',
requestTemplates: this.props.requestTemplates,
templateSelectionExpression: this.props.templateSelectionExpression,
responses: this.props.responses,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ describe('MockWebSocketIntegration', () => {
new WebSocketApi(stack, 'Api', {
defaultRouteOptions: {
integration: new WebSocketMockIntegration('DefaultIntegration', {
requestTemplates: { 'application/json': '{ "statusCode": 200 }' },
templateSelectionExpression: '\\$default',
responses: [{ responseKey: WebSocketIntegrationResponseKey.success }],
}),
returnResponse: true,
Expand All @@ -40,8 +38,6 @@ describe('MockWebSocketIntegration', () => {
Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::Integration', {
IntegrationType: 'MOCK',
IntegrationUri: '',
RequestTemplates: { 'application/json': '{ "statusCode": 200 }' },
TemplateSelectionExpression: '\\$default',
});
Template.fromStack(stack).hasResourceProperties('AWS::ApiGatewayV2::IntegrationResponse', {
ApiId: { Ref: 'ApiF70053CD' },
Expand Down

0 comments on commit 279bac0

Please sign in to comment.