In my unit tests, I want to create an embedded (in-process/in-memory) Hazelcast instance that does not attempt to start or perform any networking operations at all.
How
FWIW I have created a test in Hazelcast 3.6.1 and programmatically disabled the network cluster using the following code in the constructor. This creates a standalone server for testing.
It's not as quick as using a mock but it is faster than accepting the default config.
Config config = new Config();
config.setProperty("hazelcast.shutdownhook.enabled", "false");
NetworkConfig network = config.getNetworkConfig();
network.getJoin().getTcpIpConfig().setEnabled(false);
network.getJoin().getMulticastConfig().setEnabled(false);
HazelcastInstance instance = Hazelcast.newHazelcastInstance(config);