@Test public void testValidateOldListener() { KafkaListeners oldListeners = new KafkaListenersBuilder() .withNewPlain() .withAuth(new KafkaListenerAuthenticationScramSha512()) .endPlain() .withNewTls() .withAuth(new KafkaListenerAuthenticationTls()) .endTls() .withNewKafkaListenerExternalRoute() .withAuth(new KafkaListenerAuthenticationTls()) .endKafkaListenerExternalRoute() .build(); List<GenericKafkaListener> newListeners = ListenersConvertor.convertToNewFormat(oldListeners); ListenersValidator.validate(3, newListeners); }
public static void validate(int replicas, List<GenericKafkaListener> listeners) throws InvalidResourceException { Set<String> errors = validateAndGetErrorMessages(replicas, listeners); if (!errors.isEmpty()) { LOG.error("Listener configuration is not valid: {}", errors); throw new InvalidResourceException("Listener configuration is not valid: " + errors); } }
ListenersValidator { public static void validate(int replicas, List<GenericKafkaListener> listeners) throws InvalidResourceException { Set<String> errors = validateAndGetErrorMessages(replicas, listeners); if (!errors.isEmpty()) { LOG.error("Listener configuration is not valid: {}", errors); throw new InvalidResourceException("Listener configuration is not valid: " + errors); } } }
ListenersValidator { public static void validate(int replicas, List<GenericKafkaListener> listeners) throws InvalidResourceException { Set<String> errors = validateAndGetErrorMessages(replicas, listeners); if (!errors.isEmpty()) { LOG.error("Listener configuration is not valid: {}", errors); throw new InvalidResourceException("Listener configuration is not valid: " + errors); } }  }
ListenersValidator { public static void validate(int replicas, List<GenericKafkaListener> listeners) throws InvalidResourceException { Set<String> errors = validateAndGetErrorMessages(replicas, listeners); if (!errors.isEmpty()) { LOG.error("Listener configuration is not valid: {}", errors); throw new InvalidResourceException("Listener configuration is not valid: " + errors); } }  static void validate(int replicas, List<GenericKafkaListener> listeners); }
ListenersValidator { public static void validate(int replicas, List<GenericKafkaListener> listeners) throws InvalidResourceException { Set<String> errors = validateAndGetErrorMessages(replicas, listeners); if (!errors.isEmpty()) { LOG.error("Listener configuration is not valid: {}", errors); throw new InvalidResourceException("Listener configuration is not valid: " + errors); } }  static void validate(int replicas, List<GenericKafkaListener> listeners); final static List<Integer> FORBIDDEN_PORTS; final static int LOWEST_ALLOWED_PORT_NUMBER; }