How do you create a Hazelcast instance embedded in-process/in-memory, without networking?

后端 未结 6 750
深忆病人
深忆病人 2021-02-14 02:09

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

6条回答
  •  别跟我提以往
    2021-02-14 02:25

    You can create in memory without mock like this:

    HazelcastInstance hazelcastInstance = Hazelcast.newHazelcastInstance();
    

    Other params in your constructor you can use mock, this way your code will work well.

提交回复
热议问题