@Test public void addCorrectHeaderToRequest() { AmbariRequestInterceptor requestInterceptor = new AmbariRequestInterceptor(usernamePasswordCredentials); RequestInterceptor.RequestFacade requestFacade = mock(RequestInterceptor.RequestFacade.class); requestInterceptor.intercept(requestFacade); verify(requestFacade).addHeader(HttpHeaders.AUTHORIZATION, HttpTool.toBasicAuthorizationValue(usernamePasswordCredentials)); verify(requestFacade).addHeader("X-Requested-By", "Brooklyn Ambari"); verify(requestFacade).addHeader("Content-Type", "text/plain"); }
@Override public void intercept(RequestFacade requestFacade) { requestFacade.addHeader(HttpHeaders.AUTHORIZATION, basicAuth); requestFacade.addHeader("X-Requested-By", "Brooklyn Ambari"); requestFacade.addHeader("Content-Type", "text/plain"); }
AmbariRequestInterceptor implements RequestInterceptor { @Override public void intercept(RequestFacade requestFacade) { requestFacade.addHeader(HttpHeaders.AUTHORIZATION, basicAuth); requestFacade.addHeader("X-Requested-By", "Brooklyn Ambari"); requestFacade.addHeader("Content-Type", "text/plain"); } }
AmbariRequestInterceptor implements RequestInterceptor { @Override public void intercept(RequestFacade requestFacade) { requestFacade.addHeader(HttpHeaders.AUTHORIZATION, basicAuth); requestFacade.addHeader("X-Requested-By", "Brooklyn Ambari"); requestFacade.addHeader("Content-Type", "text/plain"); } AmbariRequestInterceptor(UsernamePasswordCredentials usernamePasswordCredentials); }
AmbariRequestInterceptor implements RequestInterceptor { @Override public void intercept(RequestFacade requestFacade) { requestFacade.addHeader(HttpHeaders.AUTHORIZATION, basicAuth); requestFacade.addHeader("X-Requested-By", "Brooklyn Ambari"); requestFacade.addHeader("Content-Type", "text/plain"); } AmbariRequestInterceptor(UsernamePasswordCredentials usernamePasswordCredentials); @Override void intercept(RequestFacade requestFacade); }
AmbariRequestInterceptor implements RequestInterceptor { @Override public void intercept(RequestFacade requestFacade) { requestFacade.addHeader(HttpHeaders.AUTHORIZATION, basicAuth); requestFacade.addHeader("X-Requested-By", "Brooklyn Ambari"); requestFacade.addHeader("Content-Type", "text/plain"); } AmbariRequestInterceptor(UsernamePasswordCredentials usernamePasswordCredentials); @Override void intercept(RequestFacade requestFacade);  }