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()));
}
Aggregations