@@ -22,36 +22,34 @@ import (
2222 "testing"
2323
2424 "github.com/streamnative/pulsarctl/pkg/ctl/topic"
25- "github.com/stretchr/testify/assert "
25+ "github.com/stretchr/testify/require "
2626)
2727
2828func TestSplitBundle (t * testing.T ) {
2929 ns := "public/test-split-bundle-ns"
3030
3131 args := []string {"create" , ns }
3232 _ , execErr , _ , _ := TestNamespaceCommands (createNs , args )
33- assert .Nil (t , execErr )
33+ require .Nil (t , execErr )
3434
3535 args = []string {"split-bundle" , ns , "--bundle" , "0x80000000_0xc0000000" }
3636 _ , execErr , _ , _ = TestNamespaceCommands (splitBundle , args )
37- assert .NotNil (t , execErr )
38- errMsg := "code: 412 reason: Failed to find ownership for ServiceUnit:" + ns + "/0x80000000_0xc0000000"
39- assert .Equal (t , execErr .Error (), errMsg )
37+ require .Nil (t , execErr )
4038
4139 args = []string {"create" , ns + "/test-topic" , "0" }
4240 _ , _ , argsErr , err := topic .TestTopicCommands (topic .CreateTopicCmd , args )
43- assert .Nil (t , argsErr )
44- assert .Nil (t , err )
41+ require .Nil (t , argsErr )
42+ require .Nil (t , err )
4543
4644 args = []string {"bundle-range" , ns + "/test-topic" }
4745 out , execErr , _ , _ := topic .TestTopicCommands (topic .GetBundleRangeCmd , args )
48- assert .Nil (t , execErr )
46+ require .Nil (t , execErr )
4947
5048 bundle := strings .Split (out .String (), ":" )[2 ]
5149 bundle = strings .TrimSpace (bundle )
5250
5351 args = []string {"split-bundle" , ns , "--bundle" , bundle }
5452 splitOut , execErr , _ , _ := TestNamespaceCommands (splitBundle , args )
55- assert .Nil (t , execErr )
56- assert .Equal (t , splitOut .String (), "Split a namespace bundle: " + bundle + " successfully\n " )
53+ require .Nil (t , execErr )
54+ require .Equal (t , splitOut .String (), "Split a namespace bundle: " + bundle + " successfully\n " )
5755}
0 commit comments