@Test(expected = ConfigException.Null.class) public void testDefaultConfig() { Config generic = ConfigUtils.getDefaultConfig().getConfig("generic-api"); APISettings.create(generic); }
public static APISettings create(Config config) { if (config.hasPath(API_PATH)) { config = config.getConfig(API_PATH); } int port = checkPort(config.getInt(PORT_INT_PARAM)); int securePort = checkPort(config.getInt(SECURE_PORT_INT_PARAM)); String host = checkHost(config.getString(HOST_STR_PARAM)); return new APISettings(host, port, securePort, config); }
APISettings { public static APISettings create(Config config) { if (config.hasPath(API_PATH)) { config = config.getConfig(API_PATH); } int port = checkPort(config.getInt(PORT_INT_PARAM)); int securePort = checkPort(config.getInt(SECURE_PORT_INT_PARAM)); String host = checkHost(config.getString(HOST_STR_PARAM)); return new APISettings(host, port, securePort, config); } }
APISettings { public static APISettings create(Config config) { if (config.hasPath(API_PATH)) { config = config.getConfig(API_PATH); } int port = checkPort(config.getInt(PORT_INT_PARAM)); int securePort = checkPort(config.getInt(SECURE_PORT_INT_PARAM)); String host = checkHost(config.getString(HOST_STR_PARAM)); return new APISettings(host, port, securePort, config); } private  APISettings(String host, int port, int securePort, Config config); }
APISettings { public static APISettings create(Config config) { if (config.hasPath(API_PATH)) { config = config.getConfig(API_PATH); } int port = checkPort(config.getInt(PORT_INT_PARAM)); int securePort = checkPort(config.getInt(SECURE_PORT_INT_PARAM)); String host = checkHost(config.getString(HOST_STR_PARAM)); return new APISettings(host, port, securePort, config); } private  APISettings(String host, int port, int securePort, Config config); static APISettings create(Config config); String getHost(); int getPort(); int getSecurePort(); boolean isSecure(); File getKeystoreFile(); String getKeystorePassword(); String getUserName(); String getPassword(); }
APISettings { public static APISettings create(Config config) { if (config.hasPath(API_PATH)) { config = config.getConfig(API_PATH); } int port = checkPort(config.getInt(PORT_INT_PARAM)); int securePort = checkPort(config.getInt(SECURE_PORT_INT_PARAM)); String host = checkHost(config.getString(HOST_STR_PARAM)); return new APISettings(host, port, securePort, config); } private  APISettings(String host, int port, int securePort, Config config); static APISettings create(Config config); String getHost(); int getPort(); int getSecurePort(); boolean isSecure(); File getKeystoreFile(); String getKeystorePassword(); String getUserName(); String getPassword();  }