File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,27 @@ func TestApplyBasicUpdates(t *testing.T) {
8080 applier .topicConfig .Spec .ReplicationFactor = 3
8181 err = applier .Apply (ctx )
8282 require .NotNil (t , err )
83+ applier .topicConfig .Spec .ReplicationFactor = 2
84+
85+ // Settings are not deleted if AllowSettingsDeletion is false. They are
86+ // if it is true
87+ delete (applier .topicConfig .Spec .Settings , "cleanup.policy" )
88+ err = applier .Apply (ctx )
89+ require .NoError (t , err )
90+ topicInfo , err = applier .adminClient .GetTopic (ctx , topicName , true )
91+ require .NoError (t , err )
92+
93+ assert .Equal (t , "delete" , topicInfo .Config ["cleanup.policy" ])
94+
95+ applier .config .AllowSettingsDeletion = true
96+ err = applier .Apply (ctx )
97+ require .NoError (t , err )
98+ topicInfo , err = applier .adminClient .GetTopic (ctx , topicName , true )
99+ require .NoError (t , err )
100+
101+ _ , present := topicInfo .Config ["cleanup.policy" ]
102+ assert .False (t , present )
103+
83104}
84105
85106func TestApplyPlacementUpdates (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments