@Test public void writing_response_if_request_is_not_member_does_nothing() throws IOException { this.strategy.writeCreated(this.appendable, this.request, this.response); assertEquals("", this.appendable.toString()); }
@Override public void writeCreated(Appendable appendable, Object request, Object specimen) throws IOException { if (!(request instanceof Member)) return; Member member = (Member) request; appendable.append(String.format("%s = %s", member.getName(), specimen)); appendable.append("\n"); }
MemberOnlyResponseStrategy implements TracingStrategy { @Override public void writeCreated(Appendable appendable, Object request, Object specimen) throws IOException { if (!(request instanceof Member)) return; Member member = (Member) request; appendable.append(String.format("%s = %s", member.getName(), specimen)); appendable.append("\n"); } }
MemberOnlyResponseStrategy implements TracingStrategy { @Override public void writeCreated(Appendable appendable, Object request, Object specimen) throws IOException { if (!(request instanceof Member)) return; Member member = (Member) request; appendable.append(String.format("%s = %s", member.getName(), specimen)); appendable.append("\n"); }  }
MemberOnlyResponseStrategy implements TracingStrategy { @Override public void writeCreated(Appendable appendable, Object request, Object specimen) throws IOException { if (!(request instanceof Member)) return; Member member = (Member) request; appendable.append(String.format("%s = %s", member.getName(), specimen)); appendable.append("\n"); }  @Override void writeRequest(Appendable appendable, Object request); @Override void writeCreated(Appendable appendable, Object request, Object specimen); @Override void writeError(Appendable appendable, Exception exception); }
MemberOnlyResponseStrategy implements TracingStrategy { @Override public void writeCreated(Appendable appendable, Object request, Object specimen) throws IOException { if (!(request instanceof Member)) return; Member member = (Member) request; appendable.append(String.format("%s = %s", member.getName(), specimen)); appendable.append("\n"); }  @Override void writeRequest(Appendable appendable, Object request); @Override void writeCreated(Appendable appendable, Object request, Object specimen); @Override void writeError(Appendable appendable, Exception exception);  }