This is an automated email from the ASF dual-hosted git repository.

cmccabe pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 4a6287e832 MINOR: fix ClientQuotasRequestTest (#12107)
4a6287e832 is described below

commit 4a6287e832c35593f851ce8ea427741bcb7d90d1
Author: Colin Patrick McCabe <[email protected]>
AuthorDate: Mon May 2 09:06:16 2022 -0700

    MINOR: fix ClientQuotasRequestTest (#12107)
    
    Fix ClientQuotasRequestTest.testAlterClientQuotasBadIp so that it uses 
actually unresolvable hostnames.
    The previous choices "ip" and "abc-123" are now resolvable.
    
    Reviewers: David Jacot <[email protected]>, Andrew Choi 
<[email protected]>, Divij Vaidya <[email protected]>
---
 core/src/test/scala/unit/kafka/server/ClientQuotasRequestTest.scala | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/core/src/test/scala/unit/kafka/server/ClientQuotasRequestTest.scala 
b/core/src/test/scala/unit/kafka/server/ClientQuotasRequestTest.scala
index 573bd95b96..71321c1f20 100644
--- a/core/src/test/scala/unit/kafka/server/ClientQuotasRequestTest.scala
+++ b/core/src/test/scala/unit/kafka/server/ClientQuotasRequestTest.scala
@@ -294,8 +294,8 @@ class ClientQuotasRequestTest(cluster: ClusterInstance) {
 
   @ClusterTest
   def testAlterClientQuotasBadIp(): Unit = {
-    val invalidHostPatternEntity = new 
ClientQuotaEntity(Map(ClientQuotaEntity.IP -> "abc-123").asJava)
-    val unresolvableHostEntity = new 
ClientQuotaEntity(Map(ClientQuotaEntity.IP -> "ip").asJava)
+    val invalidHostPatternEntity = new 
ClientQuotaEntity(Map(ClientQuotaEntity.IP -> "not a valid host because it has 
spaces").asJava)
+    val unresolvableHostEntity = new 
ClientQuotaEntity(Map(ClientQuotaEntity.IP ->  "RFC2606.invalid").asJava)
     val expectedExceptionMessage = "not a valid IP"
     
expectInvalidRequestWithMessage(alterEntityQuotas(invalidHostPatternEntity, 
Map(IpConnectionRateProp -> Some(50.0)),
       validateOnly = true), expectedExceptionMessage)

Reply via email to