[
https://issues.apache.org/jira/browse/KAFKA-18808?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17927505#comment-17927505
]
Chia-Ping Tsai commented on KAFKA-18808:
----------------------------------------
{code:java}
Map<String, String> entries = new HashMap<>();
entries.put("client-id", "<default>");
try (var adminClient =
Admin.create(Collections.singletonMap("bootstrap.servers",
cluster.bootstrapServers()))) {
adminClient.alterClientQuotas(Collections.singletonList(new
ClientQuotaAlteration(
new
org.apache.kafka.common.quota.ClientQuotaEntity(entries),
Collections.singleton(new
ClientQuotaAlteration.Op("producer_byte_rate", 10000D))))).all().get();
TimeUnit.SECONDS.sleep(2);
Map<org.apache.kafka.common.quota.ClientQuotaEntity, Map<String,
Double>> entityMapMap = adminClient.describeClientQuotas(
ClientQuotaFilter.containsOnly(Collections.singletonList(ClientQuotaFilterComponent.ofDefaultEntity("client-id"))))
.entities().get();
Assertions.assertEquals(0, entityMapMap.size());
}
{code}
> add test to ensure the name=<default> is not equal to default quota
> -------------------------------------------------------------------
>
> Key: KAFKA-18808
> URL: https://issues.apache.org/jira/browse/KAFKA-18808
> Project: Kafka
> Issue Type: Sub-task
> Reporter: Chia-Ping Tsai
> Assignee: Chia-Ping Tsai
> Priority: Major
> Fix For: 4.1.0
>
>
> see discussion in KAFKA-18735 - the test should include following check.
> 1. Using name=<default> does not create default quota
> 2. the returned entity should have name=<default>
> 2. the filter `ClientQuotaFilterComponent.ofDefaultEntity` should return
> nothing
--
This message was sent by Atlassian Jira
(v8.20.10#820010)