Skip to content

Commit e023adf

Browse files
spulcivjovanov
authored andcommitted
test(kafka-clients-3.5.1): SaslScram with SHA-512 mechanism test added
Signed-off-by: Simone Pulcini <simone.pulcini@gmail.com>
1 parent 2655022 commit e023adf

File tree

1 file changed

+14
-0
lines changed
  • tests/src/org.apache.kafka/kafka-clients/3.5.1/src/test/java/org_apache_kafka/kafka_clients

1 file changed

+14
-0
lines changed

tests/src/org.apache.kafka/kafka-clients/3.5.1/src/test/java/org_apache_kafka/kafka_clients/KafkaClientsTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,18 @@ void testSaslPlain() {
286286
}
287287
}
288288

289+
@Test
290+
void testSaslScramSHA512() {
291+
Map<String, Object> consumerProperties = new HashMap<>();
292+
consumerProperties.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, KAFKA_SERVER);
293+
consumerProperties.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, IntegerDeserializer.class);
294+
consumerProperties.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
295+
consumerProperties.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SASL_SSL");
296+
consumerProperties.put(SaslConfigs.SASL_MECHANISM, "SCRAM-SHA-512");
297+
consumerProperties.put(SaslConfigs.SASL_JAAS_CONFIG, "org.apache.kafka.common.security.scram.ScramLoginModule required username=admin password=admin-pass;");
298+
try (KafkaConsumer consumer = new KafkaConsumer<>(consumerProperties)) {
299+
assertThat(consumer).isNotNull();
300+
}
301+
}
302+
289303
}

0 commit comments

Comments
 (0)