Skip to content

Commit

Permalink
Restore original order to IsMapContainingTest
Browse files Browse the repository at this point in the history
  • Loading branch information
tumbarumba committed Oct 12, 2024
1 parent 47fea79 commit 8fe4f74
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,26 @@ protected Matcher<?> createMatcher() {
}

@Test
@SuppressWarnings("unchecked")
public void testMatchesMapContainingMatchingKeyAndValueWithoutGenerics() {
Map map = new HashMap();
public void testMatchesMapContainingMatchingKeyAndValue() {
Map<String, Integer> map = new TreeMap<>();
map.put("a", 1);
map.put("b", 2);

assertMatches("matcherA", hasEntry(equalTo("a"), equalTo(1)), map);
assertMatches("matcherB", hasEntry(equalTo("b"), equalTo(2)), map);
assertFalse(hasEntry(equalTo("c"), equalTo(3)).matches(map), "matcherC"); // working around generics problem
assertMismatchDescription("map was [<a=1>, <b=2>]", hasEntry(equalTo("c"), equalTo(3)), map);
}

@Test
public void testMatchesMapContainingMatchingKeyAndValue() {
Map<String, Integer> map = new TreeMap<>();
@SuppressWarnings("unchecked")
public void testMatchesMapContainingMatchingKeyAndValueWithoutGenerics() {
Map map = new HashMap();
map.put("a", 1);
map.put("b", 2);

assertMatches("matcherA", hasEntry(equalTo("a"), equalTo(1)), map);
assertMatches("matcherB", hasEntry(equalTo("b"), equalTo(2)), map);
assertMismatchDescription("map was [<a=1>, <b=2>]", hasEntry(equalTo("c"), equalTo(3)), map);
assertFalse(hasEntry(equalTo("c"), equalTo(3)).matches(map), "matcherC"); // working around generics problem
}

@Test
Expand Down

0 comments on commit 8fe4f74

Please sign in to comment.