这是我想要编写junit测试的类。您能否请求帮助,我如何为hazelcastinstance编写junit测试并在地图中添加数据。
公共类A {
private A() {
}
private static int ID= null;
@Autowired
public static HazelcastInstance hazelcastInstance;
@Getter
public static final IMap<String, Map<String, String>> imap;
static {
hazelcastInstance = Hazelcast.newHazelcastInstance(new Config().setInstanceName("hazelcast-newinstance"));
vinUUIDmap = hazelcastInstance.getMap("ID");
}
public static void addID(String uuid, long ts) {
Map<String, String> idmap= new HashMap<>();
idmap.put("timestamp", ts.toString());
idmap.put("UUID", uuid);
imap.putIfAbsent(getID().toString(), idmap, 10, TimeUnit.SECONDS);
}
}