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 {
5858 return nil
5959 }
6060
61- f .RefName = requiresNotNilOrEmpty ("refName" )
61+ f .RefName = requiresNotNilOrEmpty (funcRef [ "refName" ] )
6262 if _ , found := funcRef ["arguments" ]; found {
6363 f .Arguments = funcRef ["arguments" ].(map [string ]interface {})
6464 }
Original file line number Diff line number Diff line change @@ -26,12 +26,14 @@ func TestFromFile(t *testing.T) {
2626 "./testdata/greetings.sw.json" : func (t * testing.T , w * model.Workflow ) {
2727 assert .Equal (t , "greeting" , w .ID )
2828 assert .IsType (t , & model.OperationState {}, w .States [0 ])
29+ assert .Equal (t , "greetingFunction" , w .States [0 ].(* model.OperationState ).Actions [0 ].FunctionRef .RefName )
2930 },
3031 "./testdata/greetings.sw.yaml" : func (t * testing.T , w * model.Workflow ) {
3132 assert .IsType (t , & model.OperationState {}, w .States [0 ])
3233 assert .Equal (t , "greeting" , w .ID )
3334 assert .NotEmpty (t , w .States [0 ].(* model.OperationState ).Actions )
3435 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 )
3537 },
3638 "./testdata/eventbasedgreeting.sw.json" : func (t * testing.T , w * model.Workflow ) {
3739 assert .Equal (t , "GreetingEvent" , w .Events [0 ].Name )
You can’t perform that action at this time.
0 commit comments