()
| 813 | } |
| 814 | |
| 815 | @Test |
| 816 | public void internalErrorDefaultSerializer() { |
| 817 | HttpQuery query = NettyMocks.getQuery(tsdb, "/api/error"); |
| 818 | query.getQueryBaseRoute(); |
| 819 | try { |
| 820 | throw new Exception("Internal Error"); |
| 821 | } catch (Exception e) { |
| 822 | query.internalError(e); |
| 823 | } |
| 824 | assertEquals(HttpResponseStatus.INTERNAL_SERVER_ERROR, |
| 825 | query.response().getStatus()); |
| 826 | assertEquals( |
| 827 | "{\"error\":{\"code\":500,\"message\":\"Internal Error\"", |
| 828 | query.response().getContent().toString(Charset.forName("UTF-8")) |
| 829 | .substring(0, 47)); |
| 830 | } |
| 831 | |
| 832 | @Test (expected = NullPointerException.class) |
| 833 | public void internalErrorNull() { |
nothing calls this directly
no test coverage detected