MCPcopy
hub / github.com/OpenTSDB/opentsdb / httpExternalConfigTest

Method httpExternalConfigTest

test/tools/TestConfigArgP.java:272–286  ·  view source on GitHub ↗

Validates that an HTTP URL defined config overrides the default values. @throws Exception thrown on any error

()

Source from the content-addressed store, hash-verified

270 * @throws Exception thrown on any error
271 */
272 @SuppressWarnings("unchecked")
273 @Test
274 public void httpExternalConfigTest() throws Exception {
275 try {
276 final String url = newResponderForContent("/content", configToContent(
277 new ConfigArgP().getConfig(),
278 Collections.singletonMap("tsd.network.worker_threads", "7")),
279 "plain/text");
280 ConfigArgP cap = new ConfigArgP("--config", url); // include overwrites config
281 Config config = cap.getConfig();
282 assertEquals("The HTTP overriden value for key [tsd.network.worker_threads]", 7, config.getInt("tsd.network.worker_threads"));
283 } finally {
284 webServer.removeResponder("/content");
285 }
286 }
287
288 /**
289 * Validates that an HTTP URL defined include successfully overrides

Callers

nothing calls this directly

Calls 6

configToContentMethod · 0.95
getConfigMethod · 0.95
getIntMethod · 0.95
removeResponderMethod · 0.80
getConfigMethod · 0.45

Tested by

no test coverage detected