Search in sources :

Example 1 with KafkaUserSpec

use of io.strimzi.api.kafka.model.KafkaUserSpec in project strimzi by strimzi.

the class KafkaUserModelTest method testGenerateSecretWithNoTlsAuthenticationKafkaUserReturnsNull.

@Test
public void testGenerateSecretWithNoTlsAuthenticationKafkaUserReturnsNull() {
    Secret userCert = ResourceUtils.createUserSecretTls();
    KafkaUser user = ResourceUtils.createKafkaUserTls();
    user.setSpec(new KafkaUserSpec());
    KafkaUserModel model = KafkaUserModel.fromCrd(user, UserOperatorConfig.DEFAULT_SECRET_PREFIX, UserOperatorConfig.DEFAULT_STRIMZI_ACLS_ADMIN_API_SUPPORTED);
    assertThat(model.generateSecret(), is(nullValue()));
}
Also used : Secret(io.fabric8.kubernetes.api.model.Secret) KafkaUserSpec(io.strimzi.api.kafka.model.KafkaUserSpec) KafkaUser(io.strimzi.api.kafka.model.KafkaUser) Test(org.junit.jupiter.api.Test)

Example 2 with KafkaUserSpec

use of io.strimzi.api.kafka.model.KafkaUserSpec in project strimzi by strimzi.

the class KafkaUserModelTest method testGetSimpleAclRulesWithNoSimpleAuthorizationReturnsNull.

@Test
public void testGetSimpleAclRulesWithNoSimpleAuthorizationReturnsNull() {
    Secret userCert = ResourceUtils.createUserSecretTls();
    KafkaUser user = ResourceUtils.createKafkaUserTls();
    user.setSpec(new KafkaUserSpec());
    KafkaUserModel model = KafkaUserModel.fromCrd(user, UserOperatorConfig.DEFAULT_SECRET_PREFIX, UserOperatorConfig.DEFAULT_STRIMZI_ACLS_ADMIN_API_SUPPORTED);
    assertThat(model.getSimpleAclRules(), is(nullValue()));
}
Also used : Secret(io.fabric8.kubernetes.api.model.Secret) KafkaUserSpec(io.strimzi.api.kafka.model.KafkaUserSpec) KafkaUser(io.strimzi.api.kafka.model.KafkaUser) Test(org.junit.jupiter.api.Test)

Example 3 with KafkaUserSpec

use of io.strimzi.api.kafka.model.KafkaUserSpec in project strimzi-kafka-operator by strimzi.

the class KafkaUserModelTest method testGenerateSecretWithNoTlsAuthenticationKafkaUserReturnsNull.

@Test
public void testGenerateSecretWithNoTlsAuthenticationKafkaUserReturnsNull() {
    Secret userCert = ResourceUtils.createUserSecretTls();
    KafkaUser user = ResourceUtils.createKafkaUserTls();
    user.setSpec(new KafkaUserSpec());
    KafkaUserModel model = KafkaUserModel.fromCrd(user, UserOperatorConfig.DEFAULT_SECRET_PREFIX, UserOperatorConfig.DEFAULT_STRIMZI_ACLS_ADMIN_API_SUPPORTED);
    assertThat(model.generateSecret(), is(nullValue()));
}
Also used : Secret(io.fabric8.kubernetes.api.model.Secret) KafkaUserSpec(io.strimzi.api.kafka.model.KafkaUserSpec) KafkaUser(io.strimzi.api.kafka.model.KafkaUser) Test(org.junit.jupiter.api.Test)

Example 4 with KafkaUserSpec

use of io.strimzi.api.kafka.model.KafkaUserSpec in project strimzi-kafka-operator by strimzi.

the class KafkaUserModelTest method testGetSimpleAclRulesWithNoSimpleAuthorizationReturnsNull.

@Test
public void testGetSimpleAclRulesWithNoSimpleAuthorizationReturnsNull() {
    Secret userCert = ResourceUtils.createUserSecretTls();
    KafkaUser user = ResourceUtils.createKafkaUserTls();
    user.setSpec(new KafkaUserSpec());
    KafkaUserModel model = KafkaUserModel.fromCrd(user, UserOperatorConfig.DEFAULT_SECRET_PREFIX, UserOperatorConfig.DEFAULT_STRIMZI_ACLS_ADMIN_API_SUPPORTED);
    assertThat(model.getSimpleAclRules(), is(nullValue()));
}
Also used : Secret(io.fabric8.kubernetes.api.model.Secret) KafkaUserSpec(io.strimzi.api.kafka.model.KafkaUserSpec) KafkaUser(io.strimzi.api.kafka.model.KafkaUser) Test(org.junit.jupiter.api.Test)

Aggregations

Secret (io.fabric8.kubernetes.api.model.Secret)4 KafkaUser (io.strimzi.api.kafka.model.KafkaUser)4 KafkaUserSpec (io.strimzi.api.kafka.model.KafkaUserSpec)4 Test (org.junit.jupiter.api.Test)4