@Test public void testGetExceptionResult() { Map<String, String> result = ExceptionProcessor.getExceptionResult(new Exception("abc")); String exception = result.get("exception"); assertEquals("abc", result.get("returnResult")); assertEquals("-1", result.get("returnCode")); assertTrue(exception.contains(STACK_TRACE)); }
public static Map<String, String> getExceptionResult(Exception exception) { StringWriter writer = new StringWriter(); exception.printStackTrace(new PrintWriter(writer)); String exceptionString = writer.toString().replace(EMPTY + (char) 0x00, EMPTY); return getResultsMap(exception, exceptionString); }
ExceptionProcessor { public static Map<String, String> getExceptionResult(Exception exception) { StringWriter writer = new StringWriter(); exception.printStackTrace(new PrintWriter(writer)); String exceptionString = writer.toString().replace(EMPTY + (char) 0x00, EMPTY); return getResultsMap(exception, exceptionString); } }
ExceptionProcessor { public static Map<String, String> getExceptionResult(Exception exception) { StringWriter writer = new StringWriter(); exception.printStackTrace(new PrintWriter(writer)); String exceptionString = writer.toString().replace(EMPTY + (char) 0x00, EMPTY); return getResultsMap(exception, exceptionString); }  }
ExceptionProcessor { public static Map<String, String> getExceptionResult(Exception exception) { StringWriter writer = new StringWriter(); exception.printStackTrace(new PrintWriter(writer)); String exceptionString = writer.toString().replace(EMPTY + (char) 0x00, EMPTY); return getResultsMap(exception, exceptionString); }  static Map<String, String> getExceptionResult(Exception exception); }
ExceptionProcessor { public static Map<String, String> getExceptionResult(Exception exception) { StringWriter writer = new StringWriter(); exception.printStackTrace(new PrintWriter(writer)); String exceptionString = writer.toString().replace(EMPTY + (char) 0x00, EMPTY); return getResultsMap(exception, exceptionString); }  static Map<String, String> getExceptionResult(Exception exception);  }