File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ func (f *FunctionRef) UnmarshalJSON(data []byte) error {
58
58
return nil
59
59
}
60
60
61
- f .RefName = requiresNotNilOrEmpty ("refName" )
61
+ f .RefName = requiresNotNilOrEmpty (funcRef [ "refName" ] )
62
62
if _ , found := funcRef ["arguments" ]; found {
63
63
f .Arguments = funcRef ["arguments" ].(map [string ]interface {})
64
64
}
Original file line number Diff line number Diff line change @@ -26,12 +26,14 @@ func TestFromFile(t *testing.T) {
26
26
"./testdata/greetings.sw.json" : func (t * testing.T , w * model.Workflow ) {
27
27
assert .Equal (t , "greeting" , w .ID )
28
28
assert .IsType (t , & model.OperationState {}, w .States [0 ])
29
+ assert .Equal (t , "greetingFunction" , w .States [0 ].(* model.OperationState ).Actions [0 ].FunctionRef .RefName )
29
30
},
30
31
"./testdata/greetings.sw.yaml" : func (t * testing.T , w * model.Workflow ) {
31
32
assert .IsType (t , & model.OperationState {}, w .States [0 ])
32
33
assert .Equal (t , "greeting" , w .ID )
33
34
assert .NotEmpty (t , w .States [0 ].(* model.OperationState ).Actions )
34
35
assert .NotNil (t , w .States [0 ].(* model.OperationState ).Actions [0 ].FunctionRef )
36
+ assert .Equal (t , "greetingFunction" , w .States [0 ].(* model.OperationState ).Actions [0 ].FunctionRef .RefName )
35
37
},
36
38
"./testdata/eventbasedgreeting.sw.json" : func (t * testing.T , w * model.Workflow ) {
37
39
assert .Equal (t , "GreetingEvent" , w .Events [0 ].Name )
You can’t perform that action at this time.
0 commit comments