use of io.strimzi.api.kafka.model.KafkaSpecBuilder in project strimzi by strimzi.
the class KRaftUtilsTest method testValidKafka.
@ParallelTest
public void testValidKafka() {
KafkaSpec spec = new KafkaSpecBuilder().withNewKafka().withListeners(new GenericKafkaListenerBuilder().withName("listener").withPort(9092).withTls(true).withType(KafkaListenerType.INTERNAL).withNewKafkaListenerAuthenticationTlsAuth().endKafkaListenerAuthenticationTlsAuth().build()).withNewEphemeralStorage().endEphemeralStorage().withNewKafkaAuthorizationOpa().withUrl("http://opa:8080").endKafkaAuthorizationOpa().endKafka().build();
assertDoesNotThrow(() -> KRaftUtils.validateKafkaCrForKRaft(spec));
}
use of io.strimzi.api.kafka.model.KafkaSpecBuilder in project strimzi by strimzi.
the class KRaftUtilsTest method testInvalidKafka.
@ParallelTest
public void testInvalidKafka() {
KafkaSpec spec = new KafkaSpecBuilder().withNewKafka().withListeners(new GenericKafkaListenerBuilder().withName("listener").withPort(9092).withTls(true).withType(KafkaListenerType.INTERNAL).withNewKafkaListenerAuthenticationScramSha512Auth().endKafkaListenerAuthenticationScramSha512Auth().build()).withNewJbodStorage().withVolumes(new PersistentClaimStorageBuilder().withId(0).withSize("100Gi").build(), new PersistentClaimStorageBuilder().withId(1).withSize("100Gi").build()).endJbodStorage().withNewKafkaAuthorizationSimple().endKafkaAuthorizationSimple().endKafka().build();
InvalidResourceException ex = assertThrows(InvalidResourceException.class, () -> KRaftUtils.validateKafkaCrForKRaft(spec));
assertThat(ex.getMessage(), is("Kafka configuration is not valid: [Authentication of type 'scram-sha-512` is currently not supported when the UseKRaft feature gate is enabled, Using more than one disk in a JBOD storage is currently not supported when the UseKRaft feature gate is enabled]"));
}
use of io.strimzi.api.kafka.model.KafkaSpecBuilder in project strimzi-kafka-operator by strimzi.
the class KRaftUtilsTest method testInvalidKafka.
@ParallelTest
public void testInvalidKafka() {
KafkaSpec spec = new KafkaSpecBuilder().withNewKafka().withListeners(new GenericKafkaListenerBuilder().withName("listener").withPort(9092).withTls(true).withType(KafkaListenerType.INTERNAL).withNewKafkaListenerAuthenticationScramSha512Auth().endKafkaListenerAuthenticationScramSha512Auth().build()).withNewJbodStorage().withVolumes(new PersistentClaimStorageBuilder().withId(0).withSize("100Gi").build(), new PersistentClaimStorageBuilder().withId(1).withSize("100Gi").build()).endJbodStorage().withNewKafkaAuthorizationSimple().endKafkaAuthorizationSimple().endKafka().build();
InvalidResourceException ex = assertThrows(InvalidResourceException.class, () -> KRaftUtils.validateKafkaCrForKRaft(spec));
assertThat(ex.getMessage(), is("Kafka configuration is not valid: [Authentication of type 'scram-sha-512` is currently not supported when the UseKRaft feature gate is enabled, Using more than one disk in a JBOD storage is currently not supported when the UseKRaft feature gate is enabled]"));
}
use of io.strimzi.api.kafka.model.KafkaSpecBuilder in project strimzi-kafka-operator by strimzi.
the class KRaftUtilsTest method testValidKafka.
@ParallelTest
public void testValidKafka() {
KafkaSpec spec = new KafkaSpecBuilder().withNewKafka().withListeners(new GenericKafkaListenerBuilder().withName("listener").withPort(9092).withTls(true).withType(KafkaListenerType.INTERNAL).withNewKafkaListenerAuthenticationTlsAuth().endKafkaListenerAuthenticationTlsAuth().build()).withNewEphemeralStorage().endEphemeralStorage().withNewKafkaAuthorizationOpa().withUrl("http://opa:8080").endKafkaAuthorizationOpa().endKafka().build();
assertDoesNotThrow(() -> KRaftUtils.validateKafkaCrForKRaft(spec));
}
Aggregations