44 "encoding/json"
55 "errors"
66 "fmt"
7+ "github.com/spf13/cast"
78 "strings"
89 "testing"
910 "time"
@@ -209,6 +210,8 @@ func TestAsyncInvokeWorkflow(t *testing.T) {
209210 t .Skip ("Skipping integration test" )
210211 }
211212 fcName := "sequence"
213+ //deleteWorkflowApiTest(t, fcName, HOST, PORT)
214+
212215 fn , err := InitializePyFunction ("inc" , "handler" , function .NewSignature ().
213216 AddInput ("input" , function.Int {}).
214217 AddOutput ("result" , function.Int {}).
@@ -238,8 +241,9 @@ func TestAsyncInvokeWorkflow(t *testing.T) {
238241 for {
239242 pollResult := pollWorkflowTest (t , reqIdStruct .ReqId , HOST , PORT )
240243
241- var compExecReport workflow.ExecutionReport
242- errUnmarshalExecResult := json .Unmarshal ([]byte (pollResult ), & compExecReport )
244+ fmt .Println (pollResult )
245+ var response workflow.InvocationResponse
246+ errUnmarshalExecResult := json .Unmarshal ([]byte (pollResult ), & response )
243247
244248 if errUnmarshalExecResult != nil {
245249 var unmarshalError * json.UnmarshalTypeError
@@ -249,17 +253,11 @@ func TestAsyncInvokeWorkflow(t *testing.T) {
249253 i ++
250254 time .Sleep (200 * time .Millisecond )
251255 } else {
252- result , err := GetSingleResult (& compExecReport )
253- utils .AssertNilMsg (t , err , "failed to get single result" )
254- utils .AssertEquals (t , "4" , result )
256+ utils .AssertEquals (t , 4 , cast .ToInt (response .Result ["result" ]))
255257 break
256258 }
257259 }
258260
259- // here we do not use REST API
260- getFC , b := workflow .Get (fcName )
261- utils .AssertTrue (t , b )
262- utils .AssertTrueMsg (t , wflow .Equals (getFC ), "composition comparison failed" )
263261 err = wflow .Delete ()
264262 utils .AssertNilMsg (t , err , "failed to delete composition" )
265263}
0 commit comments