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

Method internalErrorDefaultSerializer

test/tsd/TestHttpQuery.java:815–830  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 7

getQueryMethod · 0.95
getQueryBaseRouteMethod · 0.95
internalErrorMethod · 0.95
responseMethod · 0.80
getStatusMethod · 0.65
toStringMethod · 0.45
getContentMethod · 0.45

Tested by

no test coverage detected