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.
28 lines
520 B
28 lines
520 B
package dtmcli
|
|
|
|
import (
|
|
"net/url"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestTypes(t *testing.T) {
|
|
err := CatchP(func() {
|
|
idGen := IDGenerator{parentID: "12345678901234567890123"}
|
|
idGen.NewBranchID()
|
|
})
|
|
assert.Error(t, err)
|
|
err = CatchP(func() {
|
|
idGen := IDGenerator{branchID: 99}
|
|
idGen.NewBranchID()
|
|
})
|
|
err = CatchP(func() {
|
|
MustGenGid("http://localhost:8080/api/no")
|
|
})
|
|
assert.Error(t, err)
|
|
assert.Error(t, err)
|
|
_, err = BarrierFromQuery(url.Values{})
|
|
assert.Error(t, err)
|
|
|
|
}
|
|
|