@Override
  public WsResponse call(WsRequest wsRequest) {
    DefaultLocalRequest localRequest = new DefaultLocalRequest(wsRequest);
    LocalConnector.LocalResponse localResponse = localConnector.call(localRequest);
    return new ByteArrayResponse(wsRequest.getPath(), localResponse);
  }
@Test
  public void call_request() throws Exception {
    WsRequest wsRequest = new PostRequest("api/issues/search")
      .setMediaType(MediaTypes.JSON)
      .setParam("foo", "bar");
    answer(new DumbLocalResponse(400, MediaTypes.JSON, "{}".getBytes(UTF_8), Collections.<String>emptyList()));

    WsResponse wsResponse = underTest.call(wsRequest);

    Map<String, String> expectedParams = new HashMap<>();
    expectedParams.put("foo", "bar");
    verifyRequested("POST", "api/issues/search", MediaTypes.JSON, expectedParams);
    assertThat(wsResponse.code()).isEqualTo(400);
    assertThat(wsResponse.content()).isEqualTo("{}");
    assertThat(IOUtils.toString(wsResponse.contentReader())).isEqualTo("{}");
    assertThat(IOUtils.toString(wsResponse.contentStream())).isEqualTo("{}");
    assertThat(wsResponse.contentType()).isEqualTo(MediaTypes.JSON);
    assertThat(wsResponse.requestUrl()).isEqualTo("api/issues/search");
    assertThat(wsResponse.headers()).isEmpty();
  }