@Test public void addsAuthorizationHeader() { RequestTemplate template = new RequestTemplate(); BasicAuthRequestInterceptor interceptor = new BasicAuthRequestInterceptor("Aladdin", "open sesame"); interceptor.apply(template); assertThat(template) .hasHeaders( entry("Authorization", asList("Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=="))); }
@Override public void apply(RequestTemplate template) { template.header("Authorization", headerValue); }
BasicAuthRequestInterceptor implements RequestInterceptor { @Override public void apply(RequestTemplate template) { template.header("Authorization", headerValue); } }
BasicAuthRequestInterceptor implements RequestInterceptor { @Override public void apply(RequestTemplate template) { template.header("Authorization", headerValue); } BasicAuthRequestInterceptor(String username, String password);  BasicAuthRequestInterceptor(String username, String password, Charset charset); }
BasicAuthRequestInterceptor implements RequestInterceptor { @Override public void apply(RequestTemplate template) { template.header("Authorization", headerValue); } BasicAuthRequestInterceptor(String username, String password);  BasicAuthRequestInterceptor(String username, String password, Charset charset); @Override void apply(RequestTemplate template); }
BasicAuthRequestInterceptor implements RequestInterceptor { @Override public void apply(RequestTemplate template) { template.header("Authorization", headerValue); } BasicAuthRequestInterceptor(String username, String password);  BasicAuthRequestInterceptor(String username, String password, Charset charset); @Override void apply(RequestTemplate template);  }