KafkaMirrorMakerCluster extends AbstractModel { public Deployment generateDeployment(Map<String, String> annotations, boolean isOpenShift, ImagePullPolicy imagePullPolicy, List<LocalObjectReference> imagePullSecrets) { DeploymentStrategy updateStrategy = new DeploymentStrategyBuilder() .withType("RollingUpdate") .withRollingUpdate(new RollingUpdateDeploymentBuilder() .withMaxSurge(new IntOrString(1)) .withMaxUnavailable(new IntOrString(0)) .build()) .build(); return createDeployment( updateStrategy, Collections.emptyMap(), annotations, getMergedAffinity(), getInitContainers(imagePullPolicy), getContainers(imagePullPolicy), getVolumes(isOpenShift), imagePullSecrets); } 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 testGenerateDeployment() { Deployment dep = mm.generateDeployment(new HashMap<String, String>(), true, null, null); assertThat(dep.getMetadata().getName(), is(KafkaMirrorMakerResources.deploymentName(cluster))); assertThat(dep.getMetadata().getNamespace(), is(namespace)); Map<String, String> expectedLabels = expectedLabels(); assertThat(dep.getMetadata().getLabels(), is(expectedLabels)); assertThat(dep.getSpec().getSelector().getMatchLabels(), is(expectedSelectorLabels())); assertThat(dep.getSpec().getReplicas(), is(Integer.valueOf(replicas))); assertThat(dep.getSpec().getTemplate().getMetadata().getLabels(), is(expectedLabels)); assertThat(dep.getSpec().getTemplate().getSpec().getContainers().size(), is(1)); assertThat(dep.getSpec().getTemplate().getSpec().getContainers().get(0).getName(), is(KafkaMirrorMakerResources.deploymentName(this.cluster))); assertThat(dep.getSpec().getTemplate().getSpec().getContainers().get(0).getImage(), is(mm.image)); assertThat(dep.getSpec().getTemplate().getSpec().getContainers().get(0).getEnv(), is(getExpectedEnvVars())); assertThat(dep.getSpec().getTemplate().getSpec().getContainers().get(0).getPorts().size(), is(1)); checkOwnerReference(mm.createOwnerReference(), dep); }