### Question:
KeystoneAuthRealm extends AuthorizingRealm { protected SimpleHttpClient buildClient( final boolean withSslVerification, final ICertificateManager certificateManager, final SimpleHttpClient.Builder clientBuilder) { final SSLContext sslContext; final HostnameVerifier hostnameVerifier; if (withSslVerification) { sslContext = getSecureSSLContext(certificateManager); hostnameVerifier = HttpsURLConnection.getDefaultHostnameVerifier(); } else { sslContext = UntrustedSSL.getSSLContext(); hostnameVerifier = UntrustedSSL.getHostnameVerifier(); } return clientBuilder .hostnameVerifier(hostnameVerifier) .sslContext(sslContext) .provider(GsonProvider.class) .build(); } KeystoneAuthRealm(); URI getServerUri(); boolean getSslVerification(); String getDefaultDomain(); void setUrl(final String url); void setSslVerification(final boolean sslVerification); void setDefaultDomain(final String defaultDomain);  }### Answer:
@Test public void getClientTrusted() { keystoneAuthRealm.buildClient(true, certificateManager, clientBuilder); verify(clientBuilder).hostnameVerifier(same(HttpsURLConnection.getDefaultHostnameVerifier())); verify(clientBuilder).sslContext(same(sslContext)); }
@Test public void getClientUnTrusted() { keystoneAuthRealm.buildClient(false, certificateManager, clientBuilder); verify(clientBuilder).hostnameVerifier(same(UntrustedSSL.getHostnameVerifier())); verify(clientBuilder).sslContext(same(UntrustedSSL.getSSLContext())); }