ListenersUtils { public static String ingressClass(GenericKafkaListener listener) { if (listener.getConfiguration() != null) { return listener.getConfiguration().getIngressClass(); } else { return null; } }  static boolean hasListenerWithOAuth(List<GenericKafkaListener> listeners); static List<GenericKafkaListener> internalListeners(List<GenericKafkaListener> listeners); static List<GenericKafkaListener> externalListeners(List<GenericKafkaListener> listeners); static List<GenericKafkaListener> routeListeners(List<GenericKafkaListener> listeners); static List<GenericKafkaListener> loadBalancerListeners(List<GenericKafkaListener> listeners); static List<GenericKafkaListener> nodePortListeners(List<GenericKafkaListener> listeners); static List<GenericKafkaListener> ingressListeners(List<GenericKafkaListener> listeners); static boolean hasExternalListener(List<GenericKafkaListener> listeners); static boolean hasRouteListener(List<GenericKafkaListener> listeners); static boolean hasLoadBalancerListener(List<GenericKafkaListener> listeners); static boolean hasNodePortListener(List<GenericKafkaListener> listeners); static boolean hasIngressListener(List<GenericKafkaListener> listeners); static List<String> alternativeNames(List<GenericKafkaListener> listeners); static String identifier(GenericKafkaListener listener); static String envVarIdentifier(GenericKafkaListener listener); static String backwardsCompatiblePortName(GenericKafkaListener listener); static String backwardsCompatibleBootstrapServiceName(String clusterName, GenericKafkaListener listener); static String backwardsCompatibleBootstrapRouteOrIngressName(String clusterName, GenericKafkaListener listener); static String backwardsCompatibleBrokerServiceName(String clusterName, int pod, GenericKafkaListener listener); static Integer bootstrapNodePort(GenericKafkaListener listener); static Integer brokerNodePort(GenericKafkaListener listener, int pod); static String bootstrapLoadBalancerIP(GenericKafkaListener listener); static String brokerLoadBalancerIP(GenericKafkaListener listener, int pod); static Map<String, String> bootstrapAnnotations(GenericKafkaListener listener); static Map<String, String> brokerAnnotations(GenericKafkaListener listener, int pod); static String bootstrapHost(GenericKafkaListener listener); static String brokerHost(GenericKafkaListener listener, int pod); static String brokerAdvertisedHost(GenericKafkaListener listener, int pod); static Integer brokerAdvertisedPort(GenericKafkaListener listener, int pod); static List<String> loadBalancerSourceRanges(GenericKafkaListener listener); static ExternalTrafficPolicy externalTrafficPolicy(GenericKafkaListener listener); static NodeAddressType preferredNodeAddressType(GenericKafkaListener listener); static String ingressClass(GenericKafkaListener listener); static String serviceType(GenericKafkaListener listener);  }
@Test public void testIngressClass() { assertThat(ListenersUtils.ingressClass(newLoadBalancer), is(nullValue())); assertThat(ListenersUtils.ingressClass(oldExternal), is(nullValue())); assertThat(ListenersUtils.ingressClass(newIngress), is(nullValue())); assertThat(ListenersUtils.ingressClass(newIngress2), is("my-ingress")); assertThat(ListenersUtils.ingressClass(oldPlain), is(nullValue())); assertThat(ListenersUtils.ingressClass(newTls), is(nullValue())); assertThat(ListenersUtils.ingressClass(newNodePort), is(nullValue())); assertThat(ListenersUtils.ingressClass(newNodePort3), is(nullValue())); }