()
| 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 { |
nothing calls this directly
no test coverage detected