Skip to content

Commit 033822f

Browse files
committed
Test priority annotations
1 parent 081958b commit 033822f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

internal/internal_workflow_client_test.go

+23
Original file line numberDiff line numberDiff line change
@@ -1582,6 +1582,29 @@ func (s *workflowClientTestSuite) TestEagerStartWorkflowStartRequestFail() {
15821582
s.True(eagerMock.releaseCalled)
15831583
}
15841584

1585+
func (s *workflowClientTestSuite) TestStartWorkflowStartRequestWithPriority() {
1586+
client, ok := s.client.(*WorkflowClient)
1587+
s.True(ok)
1588+
1589+
s.service.EXPECT().StartWorkflowExecution(gomock.Any(), gomock.Any(), gomock.Any()).
1590+
Do(func(_ any, req *workflowservice.StartWorkflowExecutionRequest, args ...any) {
1591+
require.Equal(s.T(), &commonpb.Priority{PriorityKey: 1}, req.Priority)
1592+
}).
1593+
Return(&workflowservice.StartWorkflowExecutionResponse{}, nil)
1594+
1595+
options := StartWorkflowOptions{
1596+
ID: workflowID,
1597+
TaskQueue: taskqueue,
1598+
WorkflowExecutionTimeout: timeoutInSeconds,
1599+
WorkflowTaskTimeout: timeoutInSeconds,
1600+
Priority: Priority{PriorityKey: 1},
1601+
}
1602+
f1 := func(ctx Context, r []byte) string {
1603+
panic("this is just a stub")
1604+
}
1605+
_, _ = client.ExecuteWorkflow(context.Background(), options, f1, []byte("test"))
1606+
}
1607+
15851608
func (s *workflowClientTestSuite) TestExecuteWorkflowWithDataConverter() {
15861609
dc := iconverter.NewTestDataConverter()
15871610
s.client = NewServiceClient(s.service, nil, ClientOptions{DataConverter: dc})

0 commit comments

Comments
 (0)