File tree 3 files changed +39
-36
lines changed
packages/@aws-cdk/aws-stepfunctions/test
3 files changed +39
-36
lines changed Original file line number Diff line number Diff line change
1
+ import * as iam from '@aws-cdk/aws-iam' ;
2
+ import * as constructs from 'constructs' ;
3
+ import * as sfn from '../lib' ;
4
+
5
+ export interface FakeTaskProps extends sfn . TaskStateBaseProps {
6
+ parameters ?: { [ key : string ] : string } ;
7
+ }
8
+
9
+ /**
10
+ * Task extending sfn.TaskStateBase to facilitate integ testing setting credentials
11
+ */
12
+ export class FakeTask extends sfn . TaskStateBase {
13
+ protected readonly taskMetrics ?: sfn . TaskMetricsConfig ;
14
+ protected readonly taskPolicies ?: iam . PolicyStatement [ ] ;
15
+ protected readonly parameters ?: { [ key : string ] : string } ;
16
+
17
+ constructor ( scope : constructs . Construct , id : string , props : FakeTaskProps = { } ) {
18
+ super ( scope , id , props ) ;
19
+ this . parameters = props . parameters ;
20
+ }
21
+
22
+ protected _renderTask ( ) : any {
23
+ return {
24
+ Type : 'Task' ,
25
+ Resource : 'arn:aws:states:::dynamodb:putItem' ,
26
+ Parameters : {
27
+ TableName : 'my-cool-table' ,
28
+ Item : {
29
+ id : {
30
+ S : 'my-entry' ,
31
+ } ,
32
+ } ,
33
+ ...this . parameters ,
34
+ } ,
35
+ } ;
36
+ }
37
+ }
Original file line number Diff line number Diff line change 1
1
import * as iam from '@aws-cdk/aws-iam' ;
2
2
import * as cdk from '@aws-cdk/core' ;
3
3
import { IntegTest } from '@aws-cdk/integ-tests' ;
4
- import * as constructs from 'constructs ' ;
4
+ import { FakeTask } from './fake-task ' ;
5
5
import * as sfn from '../lib' ;
6
6
7
- export interface FakeTaskProps extends sfn . TaskStateBaseProps {
8
- parameters ?: { [ key : string ] : string } ;
9
- }
10
-
11
- /**
12
- * Task extending sfn.TaskStateBase to facilitate integ testing setting credentials
13
- */
14
- export class FakeTask extends sfn . TaskStateBase {
15
- protected readonly taskMetrics ?: sfn . TaskMetricsConfig ;
16
- protected readonly taskPolicies ?: iam . PolicyStatement [ ] ;
17
- protected readonly parameters ?: { [ key : string ] : string } ;
18
-
19
- constructor ( scope : constructs . Construct , id : string , props : FakeTaskProps = { } ) {
20
- super ( scope , id , props ) ;
21
- this . parameters = props . parameters ;
22
- }
23
-
24
- protected _renderTask ( ) : any {
25
- return {
26
- Type : 'Task' ,
27
- Resource : 'arn:aws:states:::dynamodb:putItem' ,
28
- Parameters : {
29
- TableName : 'my-cool-table' ,
30
- Item : {
31
- id : {
32
- S : 'my-entry' ,
33
- } ,
34
- } ,
35
- ...this . parameters ,
36
- } ,
37
- } ;
38
- }
39
- }
40
-
41
7
/*
42
8
* Stack verification steps:
43
9
*
Original file line number Diff line number Diff line change 1
1
import * as cdk from '@aws-cdk/core' ;
2
- import { FakeTask } from './integ.state-machine-credentials ' ;
2
+ import { FakeTask } from './fake-task ' ;
3
3
import { renderGraph } from './private/render-util' ;
4
4
import { JsonPath } from '../lib' ;
5
5
You can’t perform that action at this time.
0 commit comments