use of org.infinispan.client.rest.configuration.RestClientConfiguration in project infinispan by infinispan.
the class RestConnectorTest method testUrlWithoutCredentials.
@Test
public void testUrlWithoutCredentials() {
RestConnector connector = new RestConnector();
RestConnection connection = (RestConnection) connector.getConnection("http://localhost:11222", null);
RestClientConfigurationBuilder builder = connection.getBuilder();
RestClientConfiguration configuration = builder.build();
assertEquals(11222, configuration.servers().get(0).port());
assertEquals("localhost", configuration.servers().get(0).host());
assertFalse(configuration.security().authentication().enabled());
}
use of org.infinispan.client.rest.configuration.RestClientConfiguration in project infinispan by infinispan.
the class RestConnectorTest method testUrlWithSSL.
@Test
public void testUrlWithSSL() throws NoSuchAlgorithmException {
RestConnector connector = new RestConnector();
RestConnection connection = (RestConnection) connector.getConnection("https://localhost", null);
RestClientConfigurationBuilder builder = connection.getBuilder();
builder.security().ssl().sslContext(SSLContext.getDefault()).trustManagers(new TrustManager[] { new ZeroSecurityTrustManager() });
RestClientConfiguration configuration = builder.build();
assertEquals(443, configuration.servers().get(0).port());
assertEquals("localhost", configuration.servers().get(0).host());
assertFalse(configuration.security().authentication().enabled());
assertTrue(configuration.security().ssl().enabled());
}
use of org.infinispan.client.rest.configuration.RestClientConfiguration in project infinispan by infinispan.
the class RestConnectorTest method testPlainHostPort.
@Test
public void testPlainHostPort() {
RestConnector connector = new RestConnector();
RestConnection connection = (RestConnection) connector.getConnection("my.host.com:12345", null);
RestClientConfigurationBuilder builder = connection.getBuilder();
RestClientConfiguration configuration = builder.build();
assertEquals(12345, configuration.servers().get(0).port());
assertEquals("my.host.com", configuration.servers().get(0).host());
}
Aggregations