Skip to content

Commit cc7e1a3

Browse files
authored
feat(*): change test resources expression to jq (#73)
Signed-off-by: lsytj0413 <511121939@qq.com> Signed-off-by: lsytj0413 <511121939@qq.com>
1 parent 49155eb commit cc7e1a3

21 files changed

+59
-59
lines changed

parser/testdata/workflows/applicationrequest-issue16.sw.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ states:
2525
- name: CheckApplication
2626
type: switch
2727
dataConditions:
28-
- condition: "{{ $.applicants[?(@.age >= 18)] }}"
28+
- condition: "${ .applicants | .age >= 18 }"
2929
transition: StartApplication
30-
- condition: "{{ $.applicants[?(@.age < 18)] }}"
30+
- condition: "${ .applicants | .age < 18 }"
3131
transition: RejectApplication
3232
defaultCondition:
3333
transition: RejectApplication
@@ -44,5 +44,5 @@ states:
4444
- functionRef:
4545
refName: sendRejectionEmailFunction
4646
arguments:
47-
applicant: "{{ $.applicant }}"
47+
applicant: "${ .applicant }"
4848
end: true

parser/testdata/workflows/applicationrequest-issue69.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
"type": "switch",
2626
"dataConditions": [
2727
{
28-
"condition": "{{ $.applicants[?(@.age >= 18)] }}",
28+
"condition": "${ .applicants | .age >= 18 }",
2929
"transition": {
3030
"nextState": "StartApplication"
3131
}
3232
},
3333
{
34-
"condition": "{{ $.applicants[?(@.age < 18)] }}",
34+
"condition": "${ .applicants | .age < 18 }",
3535
"transition": {
3636
"nextState": "RejectApplication"
3737
}
@@ -66,7 +66,7 @@
6666
"functionRef": {
6767
"refName": "sendRejectionEmailFunction",
6868
"parameters": {
69-
"applicant": "{{ $.applicant }}"
69+
"applicant": "${ .applicant }"
7070
}
7171
}
7272
}

parser/testdata/workflows/applicationrequest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
"type": "switch",
3232
"dataConditions": [
3333
{
34-
"condition": "{{ $.applicants[?(@.age >= 18)] }}",
34+
"condition": "${ .applicants | .age >= 18 }",
3535
"transition": {
3636
"nextState": "StartApplication"
3737
}
3838
},
3939
{
40-
"condition": "{{ $.applicants[?(@.age < 18)] }}",
40+
"condition": "${ .applicants | .age < 18 }",
4141
"transition": {
4242
"nextState": "RejectApplication"
4343
}
@@ -72,7 +72,7 @@
7272
"functionRef": {
7373
"refName": "sendRejectionEmailFunction",
7474
"parameters": {
75-
"applicant": "{{ $.applicant }}"
75+
"applicant": "${ .applicant }"
7676
}
7777
}
7878
}

parser/testdata/workflows/applicationrequest.multiauth.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@
4242
"type": "switch",
4343
"dataConditions": [
4444
{
45-
"condition": "{{ $.applicants[?(@.age >= 18)] }}",
45+
"condition": "${ .applicants | .age >= 18 }",
4646
"transition": {
4747
"nextState": "StartApplication"
4848
}
4949
},
5050
{
51-
"condition": "{{ $.applicants[?(@.age < 18)] }}",
51+
"condition": "${ .applicants | .age < 18 }",
5252
"transition": {
5353
"nextState": "RejectApplication"
5454
}
@@ -83,7 +83,7 @@
8383
"functionRef": {
8484
"refName": "sendRejectionEmailFunction",
8585
"parameters": {
86-
"applicant": "{{ $.applicant }}"
86+
"applicant": "${ .applicant }"
8787
}
8888
}
8989
}

parser/testdata/workflows/applicationrequest.rp.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
"type": "switch",
1616
"dataConditions": [
1717
{
18-
"condition": "{{ $.applicants[?(@.age >= 18)] }}",
18+
"condition": "${ .applicants | .age >= 18 }",
1919
"transition": {
2020
"nextState": "StartApplication"
2121
}
2222
},
2323
{
24-
"condition": "{{ $.applicants[?(@.age < 18)] }}",
24+
"condition": "${ .applicants | .age < 18 }",
2525
"transition": {
2626
"nextState": "RejectApplication"
2727
}
@@ -56,7 +56,7 @@
5656
"functionRef": {
5757
"refName": "sendRejectionEmailFunction",
5858
"arguments": {
59-
"applicant": "{{ $.applicant }}"
59+
"applicant": "${ .applicant }"
6060
}
6161
}
6262
}

parser/testdata/workflows/applicationrequest.url.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
"type": "switch",
1616
"dataConditions": [
1717
{
18-
"condition": "{{ $.applicants[?(@.age >= 18)] }}",
18+
"condition": "${ .applicants | .age >= 18 }",
1919
"transition": {
2020
"nextState": "StartApplication"
2121
}
2222
},
2323
{
24-
"condition": "{{ $.applicants[?(@.age < 18)] }}",
24+
"condition": "${ .applicants | .age < 18 }",
2525
"transition": {
2626
"nextState": "RejectApplication"
2727
}
@@ -56,7 +56,7 @@
5656
"functionRef": {
5757
"refName": "sendRejectionEmailFunction",
5858
"parameters": {
59-
"applicant": "{{ $.applicant }}"
59+
"applicant": "${ .applicant }"
6060
}
6161
}
6262
}

parser/testdata/workflows/checkinbox.cron-test.sw.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ states:
3535
transition: SendTextForHighPriority
3636
- name: SendTextForHighPriority
3737
type: foreach
38-
inputCollection: "{{ $.messages }}"
38+
inputCollection: "${ .messages }"
3939
iterationParam: singlemessage
4040
actions:
4141
- functionRef:
4242
refName: sendTextFunction
4343
arguments:
44-
message: "{{ $.singlemessage }}"
44+
message: "${ .singlemessage }"
4545
end: true

parser/testdata/workflows/checkinbox.sw.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ states:
3838
nextState: SendTextForHighPriority
3939
- name: SendTextForHighPriority
4040
type: foreach
41-
inputCollection: "{{ $.messages }}"
41+
inputCollection: "${ .messages }"
4242
iterationParam: singlemessage
4343
actions:
4444
- functionRef:
4545
refName: sendTextFunction
4646
arguments:
47-
message: "{{ $.singlemessage }}"
47+
message: "${ .singlemessage }"
4848
end:
4949
terminate: true

parser/testdata/workflows/eventbaseddataandswitch.sw.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"type": "switch",
2626
"dataConditions": [
2727
{
28-
"condition": "${ true }",
28+
"condition": "${ true }",
2929
"transition": "CheckVisaStatus"
3030
}
3131
]

parser/testdata/workflows/eventbasedgreeting.sw.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@
3030
"GreetingEvent"
3131
],
3232
"eventDataFilter": {
33-
"data": "{{ $.data.greet }}"
33+
"data": "${ .data | .greet }"
3434
},
3535
"actions": [
3636
{
3737
"functionRef": {
3838
"refName": "greetingFunction",
3939
"arguments": {
40-
"name": "{{ $.greet.name }}"
40+
"name": "${ .greet | .name }"
4141
}
4242
}
4343
}
4444
]
4545
}
4646
],
4747
"stateDataFilter": {
48-
"output": "{{ $.payload.greeting }}"
48+
"output": "${ .payload | .greeting }"
4949
},
5050
"end": {
5151
"terminate": true

0 commit comments

Comments
 (0)