use of com.hazelcast.config.FlakeIdGeneratorConfig in project hazelcast by hazelcast.
the class FlakeIdGeneratorProxyTest method initialize.
public void initialize(FlakeIdGeneratorConfig config) {
ILogger logger = mock(ILogger.class);
clusterService = mock(ClusterService.class);
NodeEngine nodeEngine = mock(NodeEngine.class);
FlakeIdGeneratorService service = mock(FlakeIdGeneratorService.class);
when(nodeEngine.getLogger(FlakeIdGeneratorProxy.class)).thenReturn(logger);
when(nodeEngine.isRunning()).thenReturn(true);
config.setName("foo");
when(nodeEngine.getConfig()).thenReturn(new Config().addFlakeIdGeneratorConfig(config));
when(nodeEngine.getClusterService()).thenReturn(clusterService);
Address address = null;
try {
address = new Address("127.0.0.1", 5701);
} catch (UnknownHostException e) {
// no-op
}
when(nodeEngine.getLocalMember()).thenReturn(new MemberImpl(address, MemberVersion.UNKNOWN, true, UUID.randomUUID()));
UUID source = nodeEngine.getLocalMember().getUuid();
gen = new FlakeIdGeneratorProxy("foo", nodeEngine, service, source);
}
use of com.hazelcast.config.FlakeIdGeneratorConfig in project hazelcast by hazelcast.
the class DynamicConfigTest method assertConfigurationsEqualOnAllMembers.
private void assertConfigurationsEqualOnAllMembers(FlakeIdGeneratorConfig config) {
for (HazelcastInstance instance : members) {
FlakeIdGeneratorConfig registeredConfig = instance.getConfig().getFlakeIdGeneratorConfig(config.getName());
assertEquals(config, registeredConfig);
}
}
Aggregations