use of com.hazelcast.test.starter.constructor.FirewallingNetworkingInstanceConstructor in project hazelcast by hazelcast.
the class FirewallingConnectionManagerConstructorTest method testConstructor.
@Test
public void testConstructor() throws Exception {
Server delegate = mock(Server.class);
Address address = new Address("172.16.16.1", 4223);
Set<Address> blockedAddresses = Collections.singleton(address);
FirewallingServer ns = new FirewallingServer(delegate, blockedAddresses);
FirewallingNetworkingInstanceConstructor constructor = new FirewallingNetworkingInstanceConstructor(FirewallingServer.class);
FirewallingServer clonedConnectionManager = (FirewallingServer) constructor.createNew(ns);
assertEquals(delegate, getFieldValueReflectively(clonedConnectionManager, "delegate"));
assertEquals(blockedAddresses, getFieldValueReflectively(clonedConnectionManager, "blockedAddresses"));
}
Aggregations