@Test public void consume() { Map<String, String> returnResult = new HashMap<>(); StatusLine statusLine = new StatusLine() { @Override public ProtocolVersion getProtocolVersion() { return new ProtocolVersion("HTTP", 1, 1); } @Override public int getStatusCode() { return 200; } @Override public String getReasonPhrase() { return "OK"; } }; statusConsumer.setStatusLine(statusLine).consume(returnResult); }
public void consume(Map<String, String> returnResult) { int statusLine = (this.statusLine != null) ? this.statusLine.getStatusCode() : 0; returnResult.put(HttpClientService.STATUS_CODE, String.valueOf(statusLine)); String protocolVersion = (this.statusLine != null && this.statusLine.getProtocolVersion() != null) ? this.statusLine.getProtocolVersion().toString() : ""; returnResult.put(HttpClientService.PROTOCOL_VERSION, protocolVersion); String reasonPhrase = (this.statusLine != null && this.statusLine.getReasonPhrase() != null) ? this.statusLine.getReasonPhrase() : ""; returnResult.put(HttpClientService.REASON_PHRASE, reasonPhrase); }
StatusConsumer { public void consume(Map<String, String> returnResult) { int statusLine = (this.statusLine != null) ? this.statusLine.getStatusCode() : 0; returnResult.put(HttpClientService.STATUS_CODE, String.valueOf(statusLine)); String protocolVersion = (this.statusLine != null && this.statusLine.getProtocolVersion() != null) ? this.statusLine.getProtocolVersion().toString() : ""; returnResult.put(HttpClientService.PROTOCOL_VERSION, protocolVersion); String reasonPhrase = (this.statusLine != null && this.statusLine.getReasonPhrase() != null) ? this.statusLine.getReasonPhrase() : ""; returnResult.put(HttpClientService.REASON_PHRASE, reasonPhrase); } }
StatusConsumer { public void consume(Map<String, String> returnResult) { int statusLine = (this.statusLine != null) ? this.statusLine.getStatusCode() : 0; returnResult.put(HttpClientService.STATUS_CODE, String.valueOf(statusLine)); String protocolVersion = (this.statusLine != null && this.statusLine.getProtocolVersion() != null) ? this.statusLine.getProtocolVersion().toString() : ""; returnResult.put(HttpClientService.PROTOCOL_VERSION, protocolVersion); String reasonPhrase = (this.statusLine != null && this.statusLine.getReasonPhrase() != null) ? this.statusLine.getReasonPhrase() : ""; returnResult.put(HttpClientService.REASON_PHRASE, reasonPhrase); }  }
StatusConsumer { public void consume(Map<String, String> returnResult) { int statusLine = (this.statusLine != null) ? this.statusLine.getStatusCode() : 0; returnResult.put(HttpClientService.STATUS_CODE, String.valueOf(statusLine)); String protocolVersion = (this.statusLine != null && this.statusLine.getProtocolVersion() != null) ? this.statusLine.getProtocolVersion().toString() : ""; returnResult.put(HttpClientService.PROTOCOL_VERSION, protocolVersion); String reasonPhrase = (this.statusLine != null && this.statusLine.getReasonPhrase() != null) ? this.statusLine.getReasonPhrase() : ""; returnResult.put(HttpClientService.REASON_PHRASE, reasonPhrase); }  StatusConsumer setStatusLine(StatusLine statusLine); void consume(Map<String, String> returnResult); }
StatusConsumer { public void consume(Map<String, String> returnResult) { int statusLine = (this.statusLine != null) ? this.statusLine.getStatusCode() : 0; returnResult.put(HttpClientService.STATUS_CODE, String.valueOf(statusLine)); String protocolVersion = (this.statusLine != null && this.statusLine.getProtocolVersion() != null) ? this.statusLine.getProtocolVersion().toString() : ""; returnResult.put(HttpClientService.PROTOCOL_VERSION, protocolVersion); String reasonPhrase = (this.statusLine != null && this.statusLine.getReasonPhrase() != null) ? this.statusLine.getReasonPhrase() : ""; returnResult.put(HttpClientService.REASON_PHRASE, reasonPhrase); }  StatusConsumer setStatusLine(StatusLine statusLine); void consume(Map<String, String> returnResult);  }