Skip to content

Commit

Permalink
test: unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
badmintoncryer committed Jan 10, 2024
1 parent 8381b52 commit 113ceea
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
21 changes: 21 additions & 0 deletions packages/@aws-cdk/aws-neptune-alpha/test/cluster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,27 @@ describe('DatabaseCluster', () => {
});
}).toThrow(/ServerlessScalingConfiguration minCapacity 10 must be less than serverlessScalingConfiguration maxCapacity 5/);
});

test('create v1.3 engine version cluster', () => {
// GIVEN
const stack = testStack();
const vpc = new ec2.Vpc(stack, 'VPC');

// WHEN
new DatabaseCluster(stack, 'Database', {
instances: 1,
vpc,
instanceType: InstanceType.R5_LARGE,
engineVersion: EngineVersion.V1_3_0_0,
});

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::Neptune::DBCluster', {
DBSubnetGroupName: { Ref: 'DatabaseSubnets3C9252C9' },
VpcSecurityGroupIds: [{ 'Fn::GetAtt': ['DatabaseSecurityGroup5C91FDCB', 'GroupId'] }],
EngineVersion: '1.3.0.0',
});
});
});

function testStack() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('ClusterParameterGroup', () => {
});

test.each([
['neptune1', ParameterGroupFamily.NEPTUNE_1], ['neptune1.2', ParameterGroupFamily.NEPTUNE_1_2],
['neptune1', ParameterGroupFamily.NEPTUNE_1], ['neptune1.2', ParameterGroupFamily.NEPTUNE_1_2], ['neptune1.3', ParameterGroupFamily.NEPTUNE_1_3],
])('create a cluster parameter group with family %s', (expectedFamily, family) => {
// GIVEN
const stack = new Stack();
Expand Down Expand Up @@ -74,7 +74,7 @@ describe('ClusterParameterGroup', () => {
});

test.each([
['neptune1', ParameterGroupFamily.NEPTUNE_1], ['neptune1.2', ParameterGroupFamily.NEPTUNE_1_2],
['neptune1', ParameterGroupFamily.NEPTUNE_1], ['neptune1.2', ParameterGroupFamily.NEPTUNE_1_2], ['neptune1.3', ParameterGroupFamily.NEPTUNE_1_3],
])('create a a instance/db parameter group with family %s', (expectedFamily, family) => {
// GIVEN
const stack = new Stack();
Expand Down

0 comments on commit 113ceea

Please sign in to comment.