MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / setPlotParams

Method setPlotParams

test/tsd/TestGraphHandler.java:67–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65 }
66
67 @Test
68 public void setPlotParams() throws Exception {
69 Plot plot = mock(Plot.class);
70 HttpQuery query = mock(HttpQuery.class);
71 Map<String, List<String>> params = Maps.newHashMap();
72 when(query.getQueryString()).thenReturn(params);
73
74 params.put("yrange", Lists.newArrayList("[0:42]"));
75 GraphHandler.setPlotParams(query, plot);
76
77 params.put("yrange", Lists.newArrayList("[33:system('touch /tmp/poc.txt')]"));
78 try {
79 GraphHandler.setPlotParams(query, plot);
80 fail("Expected BadRequestException");
81 } catch (BadRequestException e) { }
82 }
83
84 @Test // If the file doesn't exist, we don't use it, obviously.
85 public void staleCacheFileDoesntExist() throws Exception {

Callers

nothing calls this directly

Calls 3

setPlotParamsMethod · 0.95
putMethod · 0.80
getQueryStringMethod · 0.45

Tested by

no test coverage detected