Search in sources :

Example 16 with KafkaUserQuotas

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

the class KafkaUserModelTest method testFromCrdQuotaUser.

@Test
public void testFromCrdQuotaUser() {
    KafkaUserModel model = KafkaUserModel.fromCrd(quotasUser, UserOperatorConfig.DEFAULT_SECRET_PREFIX, UserOperatorConfig.DEFAULT_STRIMZI_ACLS_ADMIN_API_SUPPORTED);
    assertThat(model.namespace, is(ResourceUtils.NAMESPACE));
    assertThat(model.name, is(ResourceUtils.NAME));
    assertThat(model.labels, is(Labels.fromMap(ResourceUtils.LABELS).withStrimziKind(KafkaUser.RESOURCE_KIND).withKubernetesName(KafkaUserModel.KAFKA_USER_OPERATOR_NAME).withKubernetesInstance(ResourceUtils.NAME).withKubernetesPartOf(ResourceUtils.NAME).withKubernetesManagedBy(KafkaUserModel.KAFKA_USER_OPERATOR_NAME)));
    KafkaUserQuotas quotas = quotasUser.getSpec().getQuotas();
    assertThat(model.getQuotas().getConsumerByteRate(), is(quotas.getConsumerByteRate()));
    assertThat(model.getQuotas().getProducerByteRate(), is(quotas.getProducerByteRate()));
    assertThat(model.getQuotas().getRequestPercentage(), is(quotas.getRequestPercentage()));
    assertThat(model.getQuotas().getControllerMutationRate(), is(quotas.getControllerMutationRate()));
}
Also used : KafkaUserQuotas(io.strimzi.api.kafka.model.KafkaUserQuotas) Test(org.junit.jupiter.api.Test)

Aggregations

KafkaUserQuotas (io.strimzi.api.kafka.model.KafkaUserQuotas)16 SimpleAclRule (io.strimzi.operator.user.model.acl.SimpleAclRule)4 Test (org.junit.jupiter.api.Test)4 LabelSelector (io.fabric8.kubernetes.api.model.LabelSelector)2 Secret (io.fabric8.kubernetes.api.model.Secret)2 SecretBuilder (io.fabric8.kubernetes.api.model.SecretBuilder)2 KafkaUser (io.strimzi.api.kafka.model.KafkaUser)2 KafkaUserBuilder (io.strimzi.api.kafka.model.KafkaUserBuilder)2 Condition (io.strimzi.api.kafka.model.status.Condition)2 KafkaUserStatus (io.strimzi.api.kafka.model.status.KafkaUserStatus)2 CertManager (io.strimzi.certs.CertManager)2 Reconciliation (io.strimzi.operator.common.Reconciliation)2 Labels (io.strimzi.operator.common.model.Labels)2 MockCertManager (io.strimzi.operator.common.operator.MockCertManager)2 CrdOperator (io.strimzi.operator.common.operator.resource.CrdOperator)2 ReconcileResult (io.strimzi.operator.common.operator.resource.ReconcileResult)2 SecretOperator (io.strimzi.operator.common.operator.resource.SecretOperator)2 ResourceUtils (io.strimzi.operator.user.ResourceUtils)2 KafkaUserModel (io.strimzi.operator.user.model.KafkaUserModel)2 Future (io.vertx.core.Future)2