@@ -16,6 +16,7 @@ import (
16
16
"github.com/google/uuid"
17
17
"github.com/stretchr/testify/mock"
18
18
"github.com/stretchr/testify/require"
19
+ "go.opentelemetry.io/otel/trace"
19
20
)
20
21
21
22
func Test_Client_CreateWorkflowInstance_ParamMismatch (t * testing.T ) {
@@ -45,6 +46,7 @@ func Test_Client_GetWorkflowResultTimeout(t *testing.T) {
45
46
ctx := context .Background ()
46
47
47
48
b := & backend.MockBackend {}
49
+ b .On ("Tracer" ).Return (trace .NewNoopTracerProvider ().Tracer ("test" ))
48
50
b .On ("GetWorkflowInstanceState" , mock .Anything , instance ).Return (core .WorkflowInstanceStateActive , nil )
49
51
50
52
c := & client {
@@ -68,6 +70,7 @@ func Test_Client_GetWorkflowResultSuccess(t *testing.T) {
68
70
r , _ := converter .DefaultConverter .To (42 )
69
71
70
72
b := & backend.MockBackend {}
73
+ b .On ("Tracer" ).Return (trace .NewNoopTracerProvider ().Tracer ("test" ))
71
74
b .On ("GetWorkflowInstanceState" , mock .Anything , instance ).Return (core .WorkflowInstanceStateActive , nil ).Once ().Run (func (args mock.Arguments ) {
72
75
// After the first call, advance the clock to immediately go to the second call below
73
76
mockClock .Add (time .Second )
@@ -99,9 +102,10 @@ func Test_Client_SignalWorkflow(t *testing.T) {
99
102
ctx := context .Background ()
100
103
101
104
b := & backend.MockBackend {}
105
+ b .On ("Tracer" ).Return (trace .NewNoopTracerProvider ().Tracer ("test" ))
102
106
b .On ("Logger" ).Return (logger .NewDefaultLogger ())
103
107
b .On ("Converter" ).Return (converter .DefaultConverter )
104
- b .On ("SignalWorkflow" , ctx , instanceID , mock .MatchedBy (func (event * history.Event ) bool {
108
+ b .On ("SignalWorkflow" , mock . Anything , instanceID , mock .MatchedBy (func (event * history.Event ) bool {
105
109
return event .Type == history .EventType_SignalReceived &&
106
110
event .Attributes .(* history.SignalReceivedAttributes ).Name == "test"
107
111
})).Return (nil )
@@ -127,9 +131,10 @@ func Test_Client_SignalWorkflow_WithArgs(t *testing.T) {
127
131
input , _ := converter .DefaultConverter .To (arg )
128
132
129
133
b := & backend.MockBackend {}
134
+ b .On ("Tracer" ).Return (trace .NewNoopTracerProvider ().Tracer ("test" ))
130
135
b .On ("Logger" ).Return (logger .NewDefaultLogger ())
131
136
b .On ("Converter" ).Return (converter .DefaultConverter )
132
- b .On ("SignalWorkflow" , ctx , instanceID , mock .MatchedBy (func (event * history.Event ) bool {
137
+ b .On ("SignalWorkflow" , mock . Anything , instanceID , mock .MatchedBy (func (event * history.Event ) bool {
133
138
return event .Type == history .EventType_SignalReceived &&
134
139
event .Attributes .(* history.SignalReceivedAttributes ).Name == "test" &&
135
140
bytes .Equal (event .Attributes .(* history.SignalReceivedAttributes ).Arg , input )
0 commit comments