@@ -32,14 +32,17 @@ import (
3232func TestRetentionCmd (t * testing.T ) {
3333 topic := fmt .Sprintf ("test-retention-topic-%s" , test .RandomSuffix ())
3434
35- args := []string {"set-retention" , topic , "--time" , "12h" , "--size" , "100g" }
35+ args := []string {"create" , topic , "0" }
36+ _ , execErr , _ , _ := TestTopicCommands (CreateTopicCmd , args )
37+ assert .Nil (t , execErr )
38+
39+ args = []string {"set-retention" , topic , "--time" , "12h" , "--size" , "100g" }
3640 out , execErr , nameErr , cmdErr := TestTopicCommands (SetRetentionCmd , args )
3741 assert .Nil (t , execErr )
3842 assert .Nil (t , nameErr )
3943 assert .Nil (t , cmdErr )
4044 assert .NotNil (t , out )
4145 assert .NotEmpty (t , out .String ())
42- t .Log (fmt .Sprintf ("set-retention response: %s" , out .String ()))
4346
4447 // waiting for the pulsar to be configured
4548 <- time .After (5 * time .Second )
@@ -51,7 +54,6 @@ func TestRetentionCmd(t *testing.T) {
5154 assert .Nil (t , cmdErr )
5255 assert .NotNil (t , out )
5356 assert .NotEmpty (t , out .String ())
54- t .Log (fmt .Sprintf ("get-retention response: %s" , out .String ()))
5557
5658 var data utils.RetentionPolicies
5759 err := json .Unmarshal (out .Bytes (), & data )
@@ -66,7 +68,6 @@ func TestRetentionCmd(t *testing.T) {
6668 assert .Nil (t , cmdErr )
6769 assert .NotNil (t , out )
6870 assert .NotEmpty (t , out .String ())
69- t .Log (fmt .Sprintf ("remove-retention response: %s" , out .String ()))
7071
7172 args = []string {"get-retention" , topic }
7273 out , execErr , nameErr , cmdErr = TestTopicCommands (GetRetentionCmd , args )
@@ -75,7 +76,6 @@ func TestRetentionCmd(t *testing.T) {
7576 assert .Nil (t , cmdErr )
7677 assert .NotNil (t , out )
7778 assert .NotEmpty (t , out .String ())
78- t .Log (fmt .Sprintf ("get-retention response: %s" , out .String ()))
7979
8080 data = utils.RetentionPolicies {}
8181 err = json .Unmarshal (out .Bytes (), & data )
0 commit comments