@Test public void showTest() throws Exception { Response res = OK(Text("body"), new GenericHeaderField("foocience", "foo"), new GenericHeaderField("bariness", "bar")); String expected = "Response(code = OK(200),header = {bariness:\"bar\",foocience:\"foo\"},representation = body)"; String result1 = res.show(); String result2 = res.show(); assertEquals(expected, result1); assertEquals(expected, result2); }
public String show() { return "Response(" + "code = " + code.show() + "," + "header = " + showHeader(header) + "," + "representation = " + representation.show() + ")"; }
Response { public String show() { return "Response(" + "code = " + code.show() + "," + "header = " + showHeader(header) + "," + "representation = " + representation.show() + ")"; } }
Response { public String show() { return "Response(" + "code = " + code.show() + "," + "header = " + showHeader(header) + "," + "representation = " + representation.show() + ")"; } Response(ResponseCode code, Representation r, HeaderField ... header); }
Response { public String show() { return "Response(" + "code = " + code.show() + "," + "header = " + showHeader(header) + "," + "representation = " + representation.show() + ")"; } Response(ResponseCode code, Representation r, HeaderField ... header); boolean hasRepresentation(); Representation representation(); ResponseCode code(); HeaderField[] header(); String show(); boolean eq(Response that); }
Response { public String show() { return "Response(" + "code = " + code.show() + "," + "header = " + showHeader(header) + "," + "representation = " + representation.show() + ")"; } Response(ResponseCode code, Representation r, HeaderField ... header); boolean hasRepresentation(); Representation representation(); ResponseCode code(); HeaderField[] header(); String show(); boolean eq(Response that);  }