Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(apigatewayv2): support for mock integration type #18129

Merged
merged 6 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change integration class name to match naming standards
  • Loading branch information
atchla committed Dec 23, 2021
commit 6fd5086ba0da9227465d1dc70e7c7d7c9ba1ac96
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
/**
* Mock WebSocket Integration
*/
export class MockWebSocketIntegration extends WebSocketRouteIntegration {
export class WebSocketMockIntegration extends WebSocketRouteIntegration {

/**
* @param id id of the underlying integration construct
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { WebSocketApi, WebSocketStage } from '@aws-cdk/aws-apigatewayv2';
import { App, CfnOutput, Stack } from '@aws-cdk/core';
import { MockWebSocketIntegration } from '../../lib';
import { WebSocketMockIntegration } from '../../lib';

/*
* Stack verification steps:
Expand All @@ -11,14 +11,14 @@ const app = new App();
const stack = new Stack(app, 'integ-mock-websocket-integration');

const webSocketApi = new WebSocketApi(stack, 'mywsapi', {
defaultRouteOptions: { integration: new MockWebSocketIntegration('DefaultIntegration') },
defaultRouteOptions: { integration: new WebSocketMockIntegration('DefaultIntegration') },
});
const stage = new WebSocketStage(stack, 'mystage', {
webSocketApi,
stageName: 'dev',
autoDeploy: true,
});

webSocketApi.addRoute('sendmessage', { integration: new MockWebSocketIntegration('SendMessageIntegration') });
webSocketApi.addRoute('sendmessage', { integration: new WebSocketMockIntegration('SendMessageIntegration') });

new CfnOutput(stack, 'ApiEndpoint', { value: stage.url });
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Template } from '@aws-cdk/assertions';
import { WebSocketApi } from '@aws-cdk/aws-apigatewayv2';
import { Stack } from '@aws-cdk/core';
import { MockWebSocketIntegration } from '../../lib';
import { WebSocketMockIntegration } from '../../lib';


describe('MockWebSocketIntegration', () => {
Expand All @@ -11,7 +11,7 @@ describe('MockWebSocketIntegration', () => {

// WHEN
new WebSocketApi(stack, 'Api', {
defaultRouteOptions: { integration: new MockWebSocketIntegration('DefaultIntegration') },
defaultRouteOptions: { integration: new WebSocketMockIntegration('DefaultIntegration') },
});

// THEN
Expand Down