Kafka extends CustomResource implements HasSpecAndStatus<KafkaSpec, KafkaStatus>, UnknownPropertyPreserving { @Description("The specification of the Kafka and ZooKeeper clusters, and Topic Operator.") public KafkaSpec getSpec() { return spec; }  @Override String getApiVersion(); @Override void setApiVersion(String apiVersion); @JsonProperty("kind") @Override String getKind(); @Override ObjectMeta getMetadata(); @Override void setMetadata(ObjectMeta metadata); @Description("The specification of the Kafka and ZooKeeper clusters, and Topic Operator.") KafkaSpec getSpec(); void setSpec(KafkaSpec spec); @Override @Description("The status of the Kafka and ZooKeeper clusters, and Topic Operator.") KafkaStatus getStatus(); void setStatus(KafkaStatus status); @Override String toString(); @Override Map<String, Object> getAdditionalProperties(); @Override void setAdditionalProperty(String name, Object value); static final String V1BETA2; static final String V1BETA1; static final String V1ALPHA1; static final List<String> VERSIONS; static final String CONSUMED_VERSION; static final String SCOPE; static final String RESOURCE_KIND; static final String RESOURCE_LIST_KIND; static final String RESOURCE_GROUP; static final String RESOURCE_PLURAL; static final String RESOURCE_SINGULAR; static final String CRD_API_VERSION; static final String CRD_NAME; static final String SHORT_NAME; static final List<String> RESOURCE_SHORTNAMES; }
@Test public void testNewListeners() { Kafka model = TestUtils.fromYaml("Kafka-with-array" + ".yaml", Kafka.class); assertThat(model.getSpec().getKafka().getListeners().getGenericKafkaListeners(), is(notNullValue())); assertThat(model.getSpec().getKafka().getListeners().getGenericKafkaListeners().size(), is(2)); assertThat(model.getSpec().getKafka().getListeners().getKafkaListeners(), is(nullValue())); List<GenericKafkaListener> listeners = model.getSpec().getKafka().getListeners().getGenericKafkaListeners(); assertThat(listeners.get(0).getAuth().getType(), is("scram-sha-512")); assertThat(listeners.get(1).getAuth().getType(), is("tls")); }
@Test public void testOldListeners() { Kafka model = TestUtils.fromYaml("Kafka" + ".yaml", Kafka.class); assertThat(model.getSpec().getKafka().getListeners().getGenericKafkaListeners(), is(nullValue())); assertThat(model.getSpec().getKafka().getListeners().getKafkaListeners(), is(notNullValue())); KafkaListeners listeners = model.getSpec().getKafka().getListeners().getKafkaListeners(); assertThat(listeners.getPlain(), is(notNullValue())); assertThat(listeners.getTls(), is(notNullValue())); assertThat(listeners.getPlain().getAuth().getType(), is("scram-sha-512")); assertThat(listeners.getTls().getAuth().getType(), is("tls")); }