use of io.strimzi.test.mockkube.MockKube in project strimzi-kafka-operator by strimzi.
the class ConfigTest method testInvalidTlsSecurityProtocolConfig.
@Test
public void testInvalidTlsSecurityProtocolConfig() {
Map<String, String> map = new HashMap<>(MANDATORY);
map.put(Config.SECURITY_PROTOCOL.key, "PLAINTEXT");
map.put(Config.TLS_ENABLED.key, "true");
MockKube mockKube = new MockKube();
KubernetesClient kubeClient = mockKube.build();
Config config = new Config(map);
Session session = new Session(kubeClient, config);
assertThrows(InvalidConfigurationException.class, () -> session.adminClientProperties());
}
use of io.strimzi.test.mockkube.MockKube in project strimzi-kafka-operator by strimzi.
the class ConfigTest method testSecurityProtocolConfig.
@Test
public void testSecurityProtocolConfig() {
Map<String, String> map = new HashMap<>(MANDATORY);
map.put(Config.SECURITY_PROTOCOL.key, "SSL");
MockKube mockKube = new MockKube();
KubernetesClient kubeClient = mockKube.build();
Config config = new Config(map);
Session session = new Session(kubeClient, config);
Properties adminClientProps = session.adminClientProperties();
assertThat(adminClientProps.getProperty(SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG), is("HTTPS"));
assertThat(adminClientProps.getProperty(AdminClientConfig.SECURITY_PROTOCOL_CONFIG), is("SSL"));
}
Aggregations