Skip to content

Instantly share code, notes, and snippets.

@splatch
Created September 5, 2017 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save splatch/2e14be3907a95ddd9e9bdb4f9d149673 to your computer and use it in GitHub Desktop.
Save splatch/2e14be3907a95ddd9e9bdb4f9d149673 to your computer and use it in GitHub Desktop.
Cache<String, Integer> cache = getCache(CACHE_ID); // wrapper around Hazelcast Map
cache.put("one", 1);
cache.put("two", 2);
cache.put("three", 3);
Map<String, Integer> map = cache.asMap(); // map representation of cache
assertThat(map).hasSize(3).containsOnly(
entry("one", 1),
entry("two", 2),
entry("three", 3)
);
cache.evict("one"); // removal of elements
assertThat(map).hasSize(2).containsOnly( // <- this assertion fails
entry("two", 2),
entry("three", 3)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment