@Test public void testExecuteAndRetrieveHeaders() throws Exception { Response<String> failure = createSuccessfulResponseWithHeaders(); doReturn(failure).when(call).execute(); Headers headers = client.executeAndRetrieveHeaders(call); assertThat(headers.size(), is(1)); assertThat(headers.names(), hasItem("Custom")); assertThat(headers.get("Custom"), is("Header")); }
protected <T> Headers executeAndRetrieveHeaders(Call<T> call) throws UnauthorizedException { return Optional.ofNullable(executeCallInternal(call)) .map(Response::headers) .orElse(null); }
AbstractRemoteClient implements RemoteClient { protected <T> Headers executeAndRetrieveHeaders(Call<T> call) throws UnauthorizedException { return Optional.ofNullable(executeCallInternal(call)) .map(Response::headers) .orElse(null); } }
AbstractRemoteClient implements RemoteClient { protected <T> Headers executeAndRetrieveHeaders(Call<T> call) throws UnauthorizedException { return Optional.ofNullable(executeCallInternal(call)) .map(Response::headers) .orElse(null); } protected  AbstractRemoteClient(EndpointConnector connector, Class<S> cls); }
AbstractRemoteClient implements RemoteClient { protected <T> Headers executeAndRetrieveHeaders(Call<T> call) throws UnauthorizedException { return Optional.ofNullable(executeCallInternal(call)) .map(Response::headers) .orElse(null); } protected  AbstractRemoteClient(EndpointConnector connector, Class<S> cls); boolean authenticate(); static String prefixTokenHeader(byte[] token, @Nonnull String prefix); S svc(); static char[] byteToCharArray(byte[] bytes); final EndpointConnector connector(); @Override String endpoint(); }
AbstractRemoteClient implements RemoteClient { protected <T> Headers executeAndRetrieveHeaders(Call<T> call) throws UnauthorizedException { return Optional.ofNullable(executeCallInternal(call)) .map(Response::headers) .orElse(null); } protected  AbstractRemoteClient(EndpointConnector connector, Class<S> cls); boolean authenticate(); static String prefixTokenHeader(byte[] token, @Nonnull String prefix); S svc(); static char[] byteToCharArray(byte[] bytes); final EndpointConnector connector(); @Override String endpoint();  }