use of com.hazelcast.internal.util.VersionAwareConstructorFunction in project hazelcast by hazelcast.
the class ArrayDataSerializableFactoryTest method testCreateWithoutVersion.
@Test
public void testCreateWithoutVersion() {
ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructorFunctions = new ConstructorFunction[1];
VersionAwareConstructorFunction function = mock(VersionAwareConstructorFunction.class);
constructorFunctions[0] = function;
ArrayDataSerializableFactory factory = new ArrayDataSerializableFactory(constructorFunctions);
factory.create(0);
verify(function, times(1)).createNew(0);
verify(function, times(0)).createNew(eq(0), any(Version.class), any(Version.class));
}
use of com.hazelcast.internal.util.VersionAwareConstructorFunction in project hazelcast by hazelcast.
the class ArrayDataSerializableFactoryTest method testCreateWithVersion.
@Test
public void testCreateWithVersion() throws Exception {
ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructorFunctions = new ConstructorFunction[1];
VersionAwareConstructorFunction function = mock(VersionAwareConstructorFunction.class);
constructorFunctions[0] = function;
ArrayDataSerializableFactory factory = new ArrayDataSerializableFactory(constructorFunctions);
Version version = MemberVersion.of(3, 6, 0).asVersion();
Version wanProtocolVersion = MemberVersion.of(1, 0, 0).asVersion();
factory.create(0, version, wanProtocolVersion);
verify(function, times(0)).createNew(0);
verify(function, times(1)).createNew(0, version, wanProtocolVersion);
}
Aggregations