@Test public void testWriteResult() throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); Throwable exceptionThrown = null; try {ServletUtils.writeResult(null, out);} catch (Exception e) { exceptionThrown=e; } Assert.assertTrue(exceptionThrown != null); Assert.assertTrue(exceptionThrown.getMessage() != null); }
public static void writeResult(SearchResult result, OutputStream out) { try { IOUtils.write(JsonUtils.serialize(result), out); out.flush(); } catch (Exception e) { throw new MonetaException("Error writing result output.", e) .addContextValue("result", result); } }
ServletUtils { public static void writeResult(SearchResult result, OutputStream out) { try { IOUtils.write(JsonUtils.serialize(result), out); out.flush(); } catch (Exception e) { throw new MonetaException("Error writing result output.", e) .addContextValue("result", result); } } }
ServletUtils { public static void writeResult(SearchResult result, OutputStream out) { try { IOUtils.write(JsonUtils.serialize(result), out); out.flush(); } catch (Exception e) { throw new MonetaException("Error writing result output.", e) .addContextValue("result", result); } }  }
ServletUtils { public static void writeResult(SearchResult result, OutputStream out) { try { IOUtils.write(JsonUtils.serialize(result), out); out.flush(); } catch (Exception e) { throw new MonetaException("Error writing result output.", e) .addContextValue("result", result); } }  static void writeResult(SearchResult result, OutputStream out); static void writeError(Integer errorCode, Exception error, OutputStream out); }
ServletUtils { public static void writeResult(SearchResult result, OutputStream out) { try { IOUtils.write(JsonUtils.serialize(result), out); out.flush(); } catch (Exception e) { throw new MonetaException("Error writing result output.", e) .addContextValue("result", result); } }  static void writeResult(SearchResult result, OutputStream out); static void writeError(Integer errorCode, Exception error, OutputStream out);  }