Search in sources :

Example 6 with IdGenerator

use of com.hazelcast.core.IdGenerator in project hazelcast by hazelcast.

the class HazelcastOSGiInstanceTest method getIdGeneratorCalledSuccessfullyOverOSGiInstance.

@Test
public void getIdGeneratorCalledSuccessfullyOverOSGiInstance() {
    IdGenerator mockIdGenerator = mock(IdGenerator.class);
    HazelcastInstance mockHazelcastInstance = mock(HazelcastInstance.class);
    HazelcastOSGiInstance hazelcastOSGiInstance = HazelcastOSGiTestUtil.createHazelcastOSGiInstance(mockHazelcastInstance);
    when(mockHazelcastInstance.getIdGenerator("my-idgenerator")).thenReturn(mockIdGenerator);
    assertEquals(mockIdGenerator, hazelcastOSGiInstance.getIdGenerator("my-idgenerator"));
    verify(mockHazelcastInstance).getIdGenerator("my-idgenerator");
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) IdGenerator(com.hazelcast.core.IdGenerator) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

IdGenerator (com.hazelcast.core.IdGenerator)6 Test (org.junit.Test)4 ParallelTest (com.hazelcast.test.annotation.ParallelTest)3 QuickTest (com.hazelcast.test.annotation.QuickTest)3 HazelcastInstance (com.hazelcast.core.HazelcastInstance)2 AtomicLongService (com.hazelcast.concurrent.atomiclong.AtomicLongService)1 LongHashSet (com.hazelcast.util.collection.LongHashSet)1 ArrayList (java.util.ArrayList)1 Future (java.util.concurrent.Future)1