@Test(expectedExceptions = IllegalArgumentException.class) public void assertEmptyHttpPort() { ControllerConf controllerConf = new ControllerConf(); controllerConf.setProperty("controller.access.protocols", "http"); controllerConf.setProperty("controller.access.protocols.http.port", ""); ListenerConfigUtil.buildListenerConfigs(controllerConf); }
public static List<ListenerConfig> buildListenerConfigs(ControllerConf controllerConf) { List<ListenerConfig> listenerConfigs = new ArrayList<>(); if (controllerConf.getControllerPort() != null) { listenerConfigs.add( new ListenerConfig("http", "0.0.0.0", Integer.valueOf(controllerConf.getControllerPort()), "http", null)); } listenerConfigs.addAll(controllerConf.getControllerAccessProtocols().stream() .map(protocol -> buildListenerConfig(protocol, controllerConf)) .collect(Collectors.toList())); return listenerConfigs; }
ListenerConfigUtil { public static List<ListenerConfig> buildListenerConfigs(ControllerConf controllerConf) { List<ListenerConfig> listenerConfigs = new ArrayList<>(); if (controllerConf.getControllerPort() != null) { listenerConfigs.add( new ListenerConfig("http", "0.0.0.0", Integer.valueOf(controllerConf.getControllerPort()), "http", null)); } listenerConfigs.addAll(controllerConf.getControllerAccessProtocols().stream() .map(protocol -> buildListenerConfig(protocol, controllerConf)) .collect(Collectors.toList())); return listenerConfigs; } }
ListenerConfigUtil { public static List<ListenerConfig> buildListenerConfigs(ControllerConf controllerConf) { List<ListenerConfig> listenerConfigs = new ArrayList<>(); if (controllerConf.getControllerPort() != null) { listenerConfigs.add( new ListenerConfig("http", "0.0.0.0", Integer.valueOf(controllerConf.getControllerPort()), "http", null)); } listenerConfigs.addAll(controllerConf.getControllerAccessProtocols().stream() .map(protocol -> buildListenerConfig(protocol, controllerConf)) .collect(Collectors.toList())); return listenerConfigs; }  }
ListenerConfigUtil { public static List<ListenerConfig> buildListenerConfigs(ControllerConf controllerConf) { List<ListenerConfig> listenerConfigs = new ArrayList<>(); if (controllerConf.getControllerPort() != null) { listenerConfigs.add( new ListenerConfig("http", "0.0.0.0", Integer.valueOf(controllerConf.getControllerPort()), "http", null)); } listenerConfigs.addAll(controllerConf.getControllerAccessProtocols().stream() .map(protocol -> buildListenerConfig(protocol, controllerConf)) .collect(Collectors.toList())); return listenerConfigs; }  static List<ListenerConfig> buildListenerConfigs(ControllerConf controllerConf); }
ListenerConfigUtil { public static List<ListenerConfig> buildListenerConfigs(ControllerConf controllerConf) { List<ListenerConfig> listenerConfigs = new ArrayList<>(); if (controllerConf.getControllerPort() != null) { listenerConfigs.add( new ListenerConfig("http", "0.0.0.0", Integer.valueOf(controllerConf.getControllerPort()), "http", null)); } listenerConfigs.addAll(controllerConf.getControllerAccessProtocols().stream() .map(protocol -> buildListenerConfig(protocol, controllerConf)) .collect(Collectors.toList())); return listenerConfigs; }  static List<ListenerConfig> buildListenerConfigs(ControllerConf controllerConf);  }