@Test public void assertHttpsOnly() { ControllerConf controllerConf = new ControllerConf(); controllerConf.setProperty("controller.access.protocols", "https"); configureHttpsProperties(controllerConf, 9443); List<ListenerConfig> listenerConfigs = ListenerConfigUtil.buildListenerConfigs(controllerConf); Assert.assertEquals(listenerConfigs.size(), 1); assertHttpsListener(listenerConfigs.get(0), "0.0.0.0", 9443); }
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);  }