@Test public void testAuthAlreadySet() { headers.add(HttpHeaders.AUTHORIZATION, "banan"); authFilter.handle(clientRequest); assertTrue(!headers.get(HttpHeaders.AUTHORIZATION).contains( "Basic YWRtaW46bGFtZXBhc3M=")); }
@Override public ClientResponse handle(final ClientRequest cr) throws ClientHandlerException { if (!cr.getHeaders().containsKey(HttpHeaders.AUTHORIZATION)) { cr.getHeaders().add(HttpHeaders.AUTHORIZATION, authentication); } return getNext().handle(cr); }
BasicAuthFilter extends ClientFilter { @Override public ClientResponse handle(final ClientRequest cr) throws ClientHandlerException { if (!cr.getHeaders().containsKey(HttpHeaders.AUTHORIZATION)) { cr.getHeaders().add(HttpHeaders.AUTHORIZATION, authentication); } return getNext().handle(cr); } }
BasicAuthFilter extends ClientFilter { @Override public ClientResponse handle(final ClientRequest cr) throws ClientHandlerException { if (!cr.getHeaders().containsKey(HttpHeaders.AUTHORIZATION)) { cr.getHeaders().add(HttpHeaders.AUTHORIZATION, authentication); } return getNext().handle(cr); } BasicAuthFilter(final String username, final String password); }
BasicAuthFilter extends ClientFilter { @Override public ClientResponse handle(final ClientRequest cr) throws ClientHandlerException { if (!cr.getHeaders().containsKey(HttpHeaders.AUTHORIZATION)) { cr.getHeaders().add(HttpHeaders.AUTHORIZATION, authentication); } return getNext().handle(cr); } BasicAuthFilter(final String username, final String password); @Override ClientResponse handle(final ClientRequest cr); @Override boolean equals(Object o); @Override int hashCode(); }
BasicAuthFilter extends ClientFilter { @Override public ClientResponse handle(final ClientRequest cr) throws ClientHandlerException { if (!cr.getHeaders().containsKey(HttpHeaders.AUTHORIZATION)) { cr.getHeaders().add(HttpHeaders.AUTHORIZATION, authentication); } return getNext().handle(cr); } BasicAuthFilter(final String username, final String password); @Override ClientResponse handle(final ClientRequest cr); @Override boolean equals(Object o); @Override int hashCode();  }