use of com.hazelcast.client.config.ClientFailoverConfig in project hazelcast by hazelcast.
the class TestSpringClientFailoverContext method testBlueGreenClient.
@Test
public void testBlueGreenClient() {
HazelcastClientProxy blueGreenClient = applicationContext.getBean("blueGreenClient", HazelcastClientProxy.class);
ClientFailoverConfig failoverConfig = blueGreenClient.client.getFailoverConfig();
List<ClientConfig> clientConfigs = failoverConfig.getClientConfigs();
assertEquals(2, clientConfigs.size());
assertEquals("spring-cluster", clientConfigs.get(0).getClusterName());
assertEquals("alternativeClusterName", clientConfigs.get(1).getClusterName());
assertEquals(5, failoverConfig.getTryCount());
blueGreenClient.shutdown();
}
use of com.hazelcast.client.config.ClientFailoverConfig in project hazelcast by hazelcast.
the class FailoverConfigTest method testClientConfigWith_withAnInvalidChange.
@Test(expected = InvalidConfigurationException.class)
public void testClientConfigWith_withAnInvalidChange() {
ClientFailoverConfig clientFailoverConfig = new ClientFailoverConfig();
clientFailoverConfig.addClientConfig(new ClientConfig());
ClientConfig alternativeConfig = new ClientConfig();
alternativeConfig.setClusterName("alternative");
alternativeConfig.setProperty("newProperty", "newValue");
clientFailoverConfig.addClientConfig(alternativeConfig);
resolveClientFailoverConfig(clientFailoverConfig);
}
use of com.hazelcast.client.config.ClientFailoverConfig in project hazelcast by hazelcast.
the class FailoverConfigTest method testClientConfigWithSameClusterName.
@Test
public void testClientConfigWithSameClusterName() {
ClientFailoverConfig clientFailoverConfig = new ClientFailoverConfig();
clientFailoverConfig.addClientConfig(new ClientConfig());
clientFailoverConfig.addClientConfig(new ClientConfig());
resolveClientFailoverConfig(clientFailoverConfig);
}
use of com.hazelcast.client.config.ClientFailoverConfig in project hazelcast by hazelcast.
the class FailoverConfigTest method test_throwsException_whenFailoverConfigIsIntended_butPassedNull.
@Test(expected = HazelcastException.class)
public void test_throwsException_whenFailoverConfigIsIntended_butPassedNull() {
ClientFailoverConfig clientFailoverConfig = resolveClientFailoverConfig(null);
assertEquals(1, clientFailoverConfig.getClientConfigs().size());
assertEquals("dev", clientFailoverConfig.getClientConfigs().get(0).getClusterName());
}
use of com.hazelcast.client.config.ClientFailoverConfig in project hazelcast by hazelcast.
the class FailoverConfigTest method testClientConfigWith_withAValidChange.
@Test
public void testClientConfigWith_withAValidChange() {
ClientFailoverConfig clientFailoverConfig = new ClientFailoverConfig();
clientFailoverConfig.addClientConfig(new ClientConfig());
ClientConfig alternativeConfig = new ClientConfig();
alternativeConfig.setClusterName("alternative");
CredentialsFactoryConfig credentialsFactoryConfig = new CredentialsFactoryConfig();
credentialsFactoryConfig.setClassName("CustomCredentials");
alternativeConfig.getSecurityConfig().setCredentialsFactoryConfig(credentialsFactoryConfig);
clientFailoverConfig.addClientConfig(alternativeConfig);
resolveClientFailoverConfig(clientFailoverConfig);
}
Aggregations