java.lang.Object
io.helidon.common.testing.junit5.MapMatcher
Hamcrest matchers for
Map.-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> org.hamcrest.Matcher <Map<K, V>> mapEqualTo(Map<K, V> expected) A matcher that performsMapdeep equality.
-
Method Details
-
mapEqualTo
A matcher that performsMapdeep equality.Usage example:
assertThat(actualMap, mapEqualTo(expectedMap));This method targets trees implemented usingMapwhere values of typeMapare considered tree nodes, and values of any other type are considered leaf nodes.The deep-equality is performed by diffing a flat string representation of each map. If the diff yields no differences, the maps are considered deeply equal.
The entries are compared using strings, both keys and leaf nodes must implement
Object.toString().- Type Parameters:
K- type of the map keysV- type of the map values- Parameters:
expected- expected map- Returns:
- matcher validating the
Mapis deeply equal
-