Skip to content

Commit aafe27f

Browse files
committed
Makes ParameterizedClass classes explicit
Use explicit class names when instantiating them via ParameterizedClass instead of using Strings with the name.
1 parent 8882ae9 commit aafe27f

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

test/unit/org/apache/cassandra/audit/AuditLoggerAuthTest.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
import java.util.List;
2424
import java.util.Queue;
2525

26+
import org.apache.cassandra.auth.CassandraAuthorizer;
27+
import org.apache.cassandra.auth.CassandraRoleManager;
28+
import org.apache.cassandra.auth.PasswordAuthenticator;
29+
2630
import org.junit.AfterClass;
2731
import org.junit.Before;
2832
import org.junit.BeforeClass;
@@ -69,11 +73,11 @@ public class AuditLoggerAuthTest
6973
public static void setup() throws Exception
7074
{
7175
OverrideConfigurationLoader.override((config) -> {
72-
config.authenticator = new ParameterizedClass("PasswordAuthenticator");
73-
config.role_manager = new ParameterizedClass("CassandraRoleManager");
74-
config.authorizer = new ParameterizedClass("CassandraAuthorizer");
76+
config.authenticator = new ParameterizedClass(PasswordAuthenticator.class.getName());
77+
config.role_manager = new ParameterizedClass(CassandraRoleManager.class.getName());
78+
config.authorizer = new ParameterizedClass(CassandraAuthorizer.class.getName());
7579
config.audit_logging_options.enabled = true;
76-
config.audit_logging_options.logger = new ParameterizedClass("InMemoryAuditLogger", null);
80+
config.audit_logging_options.logger = new ParameterizedClass(InMemoryAuditLogger.class.getName(), null);
7781
});
7882

7983
SUPERUSER_SETUP_DELAY_MS.setLong(0);

test/unit/org/apache/cassandra/transport/CQLUserAuditTest.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
import java.util.concurrent.TimeUnit;
3030
import java.util.stream.Collectors;
3131

32+
import org.apache.cassandra.audit.DiagnosticEventAuditLogger;
33+
import org.apache.cassandra.auth.CassandraRoleManager;
34+
import org.apache.cassandra.auth.PasswordAuthenticator;
35+
3236
import org.junit.After;
3337
import org.junit.AfterClass;
3438
import org.junit.BeforeClass;
@@ -64,11 +68,11 @@ public class CQLUserAuditTest
6468
public static void setup() throws Exception
6569
{
6670
OverrideConfigurationLoader.override((config) -> {
67-
config.authenticator = new ParameterizedClass("PasswordAuthenticator");
68-
config.role_manager = new ParameterizedClass("CassandraRoleManager");
71+
config.authenticator = new ParameterizedClass(PasswordAuthenticator.class.getName());
72+
config.role_manager = new ParameterizedClass(CassandraRoleManager.class.getName());
6973
config.diagnostic_events_enabled = true;
7074
config.audit_logging_options.enabled = true;
71-
config.audit_logging_options.logger = new ParameterizedClass("DiagnosticEventAuditLogger", null);
75+
config.audit_logging_options.logger = new ParameterizedClass(DiagnosticEventAuditLogger.class.getName(), null);
7276
});
7377

7478
SUPERUSER_SETUP_DELAY_MS.setLong(0);

0 commit comments

Comments
 (0)