From 5747ee6fcfc7900f9a7511ef2949a3c29c80df9b Mon Sep 17 00:00:00 2001 From: Arvind Kandpal Date: Wed, 3 Jun 2026 16:31:53 +0530 Subject: [PATCH] CASSANDRA-21425 : Fix skipped tests and typos in CassandraRoleManagerTest Adds missing @Test annotations to testPasswordUpdateRateLimiting and testPasswordUpdateRateLimitingDisabled. Also fixes minor typos in comments and assertion strings. --- .../apache/cassandra/auth/CassandraRoleManagerTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/unit/org/apache/cassandra/auth/CassandraRoleManagerTest.java b/test/unit/org/apache/cassandra/auth/CassandraRoleManagerTest.java index 8c46db68cf6b..4e539ef026a8 100644 --- a/test/unit/org/apache/cassandra/auth/CassandraRoleManagerTest.java +++ b/test/unit/org/apache/cassandra/auth/CassandraRoleManagerTest.java @@ -81,7 +81,7 @@ public void setup() throws Exception public void getGrantedRolesImplMinimizesReads() { // IRoleManager::getRoleDetails was not in the initial API, so a default impl - // was added which uses the existing methods on IRoleManager as primitive to + // was added which uses the existing methods on IRoleManager as primitives to // construct the Role objects. While this will work for any IRoleManager impl // it is inefficient, so CassandraRoleManager has its own implementation which // collects all of the necessary info with a single query for each granted role. @@ -104,7 +104,7 @@ public void getGrantedRolesImplMinimizesReads() fetchRolesAndCheckReadCount(roleManager, ROLE_A); // Check that when granted roles appear multiple times in parallel levels of the hierarchy, we don't - // do redundant reads. E.g. here role_b_1, role_b_2 and role_b3 are granted to both role_b and role_c + // do redundant reads. E.g. here role_b_1, role_b_2 and role_b_3 are granted to both role_b and role_c // but we only want to actually read them once grantRolesTo(roleManager, ROLE_C, ROLE_B_1, ROLE_B_2, ROLE_B_3); fetchRolesAndCheckReadCount(roleManager, ROLE_A); @@ -165,6 +165,7 @@ public void warmCacheLoadsAllEntries() } } + @Test public void testPasswordUpdateRateLimiting() throws Exception { try @@ -194,7 +195,7 @@ public void testPasswordUpdateRateLimiting() throws Exception } catch (OverloadedException e) { - assertEquals("Password for role test_password_role can only be changed every 100ms. ", e.getMessage()); + assertEquals("Password for role test_password_role can only be changed every 100ms.", e.getMessage()); } // Wait for the rate limit interval to pass @@ -301,6 +302,7 @@ public void ctorInvalidRoleDisconnectOptions() Assertions.assertThat(crm.getInvalidClientDisconnectMaxJitterMillis()).isEqualTo(1000); } + @Test public void testPasswordUpdateRateLimitingDisabled() throws Exception { try