KafkaMirrorMakerCluster extends AbstractModel { @Override protected List<EnvVar> getEnvVars() { List<EnvVar> varList = new ArrayList<>(); varList.add(buildEnvVar(ENV_VAR_KAFKA_MIRRORMAKER_CONFIGURATION_CONSUMER, getConsumerConfiguration().getConfiguration())); varList.add(buildEnvVar(ENV_VAR_KAFKA_MIRRORMAKER_CONFIGURATION_PRODUCER, getProducerConfiguration().getConfiguration())); varList.add(buildEnvVar(ENV_VAR_KAFKA_MIRRORMAKER_METRICS_ENABLED, String.valueOf(isMetricsEnabled))); varList.add(buildEnvVar(ENV_VAR_KAFKA_MIRRORMAKER_BOOTSTRAP_SERVERS_CONSUMER, consumer.getBootstrapServers())); varList.add(buildEnvVar(ENV_VAR_KAFKA_MIRRORMAKER_BOOTSTRAP_SERVERS_PRODUCER, producer.getBootstrapServers())); varList.add(buildEnvVar(ENV_VAR_KAFKA_MIRRORMAKER_WHITELIST, whitelist)); varList.add(buildEnvVar(ENV_VAR_KAFKA_MIRRORMAKER_GROUPID_CONSUMER, consumer.getGroupId())); if (consumer.getNumStreams() != null) { varList.add(buildEnvVar(ENV_VAR_KAFKA_MIRRORMAKER_NUMSTREAMS, Integer.toString(consumer.getNumStreams()))); } if (consumer.getOffsetCommitInterval() != null) { varList.add(buildEnvVar(ENV_VAR_KAFKA_MIRRORMAKER_OFFSET_COMMIT_INTERVAL, Integer.toString(consumer.getOffsetCommitInterval()))); } if (producer.getAbortOnSendFailure() != null) { varList.add(buildEnvVar(ENV_VAR_KAFKA_MIRRORMAKER_ABORT_ON_SEND_FAILURE, Boolean.toString(producer.getAbortOnSendFailure()))); } varList.add(buildEnvVar(ENV_VAR_STRIMZI_KAFKA_GC_LOG_ENABLED, String.valueOf(gcLoggingEnabled))); if (javaSystemProperties != null) { varList.add(buildEnvVar(ENV_VAR_STRIMZI_JAVA_SYSTEM_PROPERTIES, ModelUtils.getJavaSystemPropertiesToString(javaSystemProperties))); } if (tracing != null) { varList.add(buildEnvVar(ENV_VAR_STRIMZI_TRACING, tracing.getType())); } heapOptions(varList, 1.0, 0L); jvmPerformanceOptions(varList); addConsumerEnvVars(varList); addProducerEnvVars(varList); varList.add(buildEnvVar(ENV_VAR_STRIMZI_LIVENESS_PERIOD, String.valueOf(livenessProbeOptions.getPeriodSeconds() != null ? livenessProbeOptions.getPeriodSeconds() : DEFAULT_HEALTHCHECK_PERIOD))); varList.add(buildEnvVar(ENV_VAR_STRIMZI_READINESS_PERIOD, String.valueOf(readinessProbeOptions.getPeriodSeconds() != null ? readinessProbeOptions.getPeriodSeconds() : DEFAULT_HEALTHCHECK_PERIOD))); varList.addAll(getRequiredEnvVars()); addContainerEnvsToExistingEnvs(varList, templateContainerEnvVars); return varList; } protected  KafkaMirrorMakerCluster(HasMetadata resource); static KafkaMirrorMakerCluster fromCrd(KafkaMirrorMaker kafkaMirrorMaker, KafkaVersion.Lookup versions); Deployment generateDeployment(Map<String, String> annotations, boolean isOpenShift, ImagePullPolicy imagePullPolicy, List<LocalObjectReference> imagePullSecrets); PodDisruptionBudget generatePodDisruptionBudget(); void setWhitelist(String whitelist); void setProducer(KafkaMirrorMakerProducerSpec producer); void setConsumer(KafkaMirrorMakerConsumerSpec consumer); static final Probe READINESS_PROBE_OPTIONS; }
@Test public void testEnvVars() { assertThat(mm.getEnvVars(), is(getExpectedEnvVars())); }