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

后端 未结 6 733
深忆病人
深忆病人 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 also use TestHazelcastInstanceFactory which is also used by Hazelcast internally for unit tests. You will need to add this Maven dependency for it:

    
      com.hazelcast
      hazelcast
      ${hazelcast.version}
      tests
      test
    
    

    See BasicCacheTest for an example of how it used.

提交回复
热议问题