Skip to content

Commit

Permalink
add read only test
Browse files Browse the repository at this point in the history
  • Loading branch information
petedannemann committed Nov 21, 2023
1 parent 434d602 commit 2f593fa
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pkg/admin/brokerclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -868,3 +868,24 @@ func TestBrokerClientCreateACLReadOnly(t *testing.T) {
assert.Equal(t, err, errors.New("Cannot create ACL in read-only mode"))

}

func TestBrokerClientDeleteACLReadOnly(t *testing.T) {
if !util.CanTestBrokerAdminSecurity() {
t.Skip("Skipping because KAFKA_TOPICS_TEST_BROKER_ADMIN_SECURITY is not set")
}

ctx := context.Background()
client, err := NewBrokerAdminClient(
ctx,
BrokerAdminClientConfig{
ConnectorConfig: ConnectorConfig{
BrokerAddr: util.TestKafkaAddr(),
},
ReadOnly: true,
},
)
require.NoError(t, err)
_, err = client.DeleteACLs(ctx, []kafka.DeleteACLsFilter{})

assert.Equal(t, errors.New("Cannot delete ACL in read-only mode"), err)
}

0 comments on commit 2f593fa

Please sign in to comment.