KafkaConnectS2ICluster extends KafkaConnectCluster { public ImageStream generateSourceImageStream() { ObjectReference image = new ObjectReference(); image.setKind("DockerImage"); image.setName(sourceImageBaseName + ":" + sourceImageTag); TagReference sourceTag = new TagReference(); sourceTag.setName(sourceImageTag); sourceTag.setFrom(image); sourceTag.setReferencePolicy(new TagReferencePolicyBuilder().withType("Local").build()); if (insecureSourceRepository) { sourceTag.setImportPolicy(new TagImportPolicyBuilder().withInsecure(true).build()); } ImageStream imageStream = new ImageStreamBuilder() .withNewMetadata() .withName(KafkaConnectS2IResources.sourceImageStreamName(cluster)) .withNamespace(namespace) .withLabels(getLabelsWithStrimziName(KafkaConnectS2IResources.sourceImageStreamName(cluster), null).toMap()) .withOwnerReferences(createOwnerReference()) .endMetadata() .withNewSpec() .withLookupPolicy(new ImageLookupPolicyBuilder().withLocal(false).build()) .withTags(sourceTag) .endSpec() .build(); return imageStream; } private  KafkaConnectS2ICluster(HasMetadata resource); static KafkaConnectS2ICluster fromCrd(KafkaConnectS2I kafkaConnectS2I, KafkaVersion.Lookup versions); DeploymentConfig generateDeploymentConfig(Map<String, String> annotations, boolean isOpenShift, ImagePullPolicy imagePullPolicy,
                                                     List<LocalObjectReference> imagePullSecrets); ImageStream generateSourceImageStream(); ImageStream generateTargetImageStream(); BuildConfig generateBuildConfig(); boolean isInsecureSourceRepository(); void setInsecureSourceRepository(boolean insecureSourceRepository); void setBuildResourceRequirements(ResourceRequirements buildRequirements);  }
@Test public void testGenerateSourceImageStream() { ImageStream is = kc.generateSourceImageStream(); assertThat(is.getMetadata().getName(), is(KafkaConnectS2IResources.sourceImageStreamName(cluster))); assertThat(is.getMetadata().getNamespace(), is(namespace)); assertThat(is.getMetadata().getLabels(), is(expectedLabels(KafkaConnectS2IResources.sourceImageStreamName(cluster)))); assertThat(is.getSpec().getLookupPolicy().getLocal(), is(false)); assertThat(is.getSpec().getTags().size(), is(1)); assertThat(is.getSpec().getTags().get(0).getName(), is(image.substring(image.lastIndexOf(":") + 1))); assertThat(is.getSpec().getTags().get(0).getFrom().getKind(), is("DockerImage")); assertThat(is.getSpec().getTags().get(0).getFrom().getName(), is(image)); assertThat(is.getSpec().getTags().get(0).getImportPolicy(), is(nullValue())); assertThat(is.getSpec().getTags().get(0).getReferencePolicy().getType(), is("Local")); checkOwnerReference(kc.createOwnerReference(), is); }