@Test public void process_shouldStripAnEndingNewLineFromOutput_givenAThrowable() throws Exception { Throwable expectedException = new RuntimeException(); StringBuilder output = new StringBuilder(); processor.process(expectedException, output); assertThat(output.toString(), not(endsWith("\n"))); }
@Override public void process(Throwable throwable, StringBuilder out) { StringWriter sw = new StringWriter(); throwable.printStackTrace(new PrintWriter(sw)); out.append(stripLastCharacter(sw)); }
SimpleStackTraceProcessor implements StackTraceProcessor { @Override public void process(Throwable throwable, StringBuilder out) { StringWriter sw = new StringWriter(); throwable.printStackTrace(new PrintWriter(sw)); out.append(stripLastCharacter(sw)); } }
SimpleStackTraceProcessor implements StackTraceProcessor { @Override public void process(Throwable throwable, StringBuilder out) { StringWriter sw = new StringWriter(); throwable.printStackTrace(new PrintWriter(sw)); out.append(stripLastCharacter(sw)); }  }
SimpleStackTraceProcessor implements StackTraceProcessor { @Override public void process(Throwable throwable, StringBuilder out) { StringWriter sw = new StringWriter(); throwable.printStackTrace(new PrintWriter(sw)); out.append(stripLastCharacter(sw)); }  @Override void process(Throwable throwable, StringBuilder out); }
SimpleStackTraceProcessor implements StackTraceProcessor { @Override public void process(Throwable throwable, StringBuilder out) { StringWriter sw = new StringWriter(); throwable.printStackTrace(new PrintWriter(sw)); out.append(stripLastCharacter(sw)); }  @Override void process(Throwable throwable, StringBuilder out);  }