DefaultSink implements Sink { @Override public void write(final Precorrelation precorrelation, final HttpRequest request) throws IOException { writer.write(precorrelation, formatter.format(precorrelation, request)); }  @Override boolean isActive(); @Override void write(final Precorrelation precorrelation, final HttpRequest request); @Override void write(final Correlation correlation, final HttpRequest request, final HttpResponse response);  }
@Test void writeRequest() throws IOException { when(formatter.format(precorrelation, request)).thenReturn("request"); unit.write(precorrelation, request); verify(writer).write(precorrelation, "request"); }
@Test void writeResponse() throws IOException { when(formatter.format(correlation, response)).thenReturn("response"); unit.write(correlation, request, response); verify(writer).write(correlation, "response"); }
@Test void writeBoth() throws IOException { when(formatter.format(correlation, request)).thenReturn("request"); when(formatter.format(correlation, response)).thenReturn("response"); unit.writeBoth(correlation, request, response); verify(writer).write((Precorrelation) correlation, "request"); verify(writer).write(correlation, "response"); }