@Test void givenBypassScheme_whenGenericAuthentication_thenWithout() { RequestContext.getCurrentContext().put(AUTHENTICATION_SCHEME_BY_PASS_KEY, true); SecurityContextHolder.getContext().setAuthentication(mock(Authentication.class)); assertThat(chooser.chooseClient(), is(clientWithoutCertificate)); }
public CloseableHttpClient chooseClient() { if (isRequestToSign()) { return clientWithCertificate; } else { return clientWithoutCertificate; } }
HttpClientChooser { public CloseableHttpClient chooseClient() { if (isRequestToSign()) { return clientWithCertificate; } else { return clientWithoutCertificate; } } }
HttpClientChooser { public CloseableHttpClient chooseClient() { if (isRequestToSign()) { return clientWithCertificate; } else { return clientWithoutCertificate; } } HttpClientChooser(CloseableHttpClient clientWithoutCertificate, CloseableHttpClient clientWithCertificate); }
HttpClientChooser { public CloseableHttpClient chooseClient() { if (isRequestToSign()) { return clientWithCertificate; } else { return clientWithoutCertificate; } } HttpClientChooser(CloseableHttpClient clientWithoutCertificate, CloseableHttpClient clientWithCertificate); CloseableHttpClient chooseClient(); }
HttpClientChooser { public CloseableHttpClient chooseClient() { if (isRequestToSign()) { return clientWithCertificate; } else { return clientWithoutCertificate; } } HttpClientChooser(CloseableHttpClient clientWithoutCertificate, CloseableHttpClient clientWithCertificate); CloseableHttpClient chooseClient();  }