mirror of https://github.com/dtm-labs/dtm.git
csharpjavadistributed-transactionsdtmgogolangmicroservicenodejsphpdatabasesagaseatatcctransactiontransactionsxapythondistributed
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
623 B
24 lines
623 B
package workflow
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/dtm-labs/dtm/client/dtmcli/dtmimp"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestAbnormal(t *testing.T) {
|
|
fname := dtmimp.GetFuncName()
|
|
_, err := defaultFac.execute(context.Background(), fname, fname, nil)
|
|
assert.Error(t, err)
|
|
|
|
err = defaultFac.register(fname, func(wf *Workflow, data []byte) ([]byte, error) { return nil, nil })
|
|
assert.Nil(t, err)
|
|
err = defaultFac.register(fname, nil)
|
|
assert.Error(t, err)
|
|
|
|
ws := &workflowServer{}
|
|
_, err = ws.Execute(context.Background(), nil)
|
|
assert.Contains(t, err.Error(), "call workflow.InitGrpc first")
|
|
}
|
|
|