forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathathena.test.ts
72 lines (71 loc) · 1.77 KB
/
athena.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import '@aws-cdk/assert/jest';
import { expect, haveResource } from '@aws-cdk/assert';
import * as cdk from '@aws-cdk/core';
import { CfnWorkGroup } from '../lib';
describe('Athena Workgroup Tags', () => {
test('test tag spec correction', () => {
const stack = new cdk.Stack();
new CfnWorkGroup(stack, 'Athena-Workgroup', {
name: 'HelloWorld',
description: 'A WorkGroup',
recursiveDeleteOption: true,
state: 'ENABLED',
tags: [
{
key: 'key1',
value: 'value1',
},
{
key: 'key2',
value: 'value2',
}],
workGroupConfiguration: {
requesterPaysEnabled: true,
resultConfiguration: {
outputLocation: 's3://fakebucketme/athena/results/',
},
},
});
expect(stack).to(haveResource('AWS::Athena::WorkGroup', {
Tags: [
{
Key: 'key1',
Value: 'value1',
},
{
Key: 'key2',
Value: 'value2',
},
],
}));
});
test('test tag aspect spec correction', () => {
const stack = new cdk.Stack();
cdk.Tag.add(stack, 'key1', 'value1');
cdk.Tag.add(stack, 'key2', 'value2');
new CfnWorkGroup(stack, 'Athena-Workgroup', {
name: 'HelloWorld',
description: 'A WorkGroup',
recursiveDeleteOption: true,
state: 'ENABLED',
workGroupConfiguration: {
requesterPaysEnabled: true,
resultConfiguration: {
outputLocation: 's3://fakebucketme/athena/results/',
},
},
});
expect(stack).to(haveResource('AWS::Athena::WorkGroup', {
Tags: [
{
Key: 'key1',
Value: 'value1',
},
{
Key: 'key2',
Value: 'value2',
},
],
}));
});
});