@Test public void notContainsAllOfMap() throws Exception { Map<String, String> expected = new HashMap<>(); expected.put("foo", "bar"); expected.put("other", "stuff"); assertContextExpectationFails(s -> s.subscriberContext(Context.of("foo", "bar", "foobar", "baz")), e -> e.containsAllOf(expected)) .withMessage("Expected Context Context2{foo=bar, foobar=baz} to contain all " + "of {other=stuff, foo=bar}"); }
@Test public void containsAllOfMap() throws Exception { assertContextExpectation(s -> s.subscriberContext(Context.of("foo", "bar", "foobar", "baz")), e -> e.containsAllOf(Collections.singletonMap("foo", "bar"))); }
@Test public void notContainsAllOfContext() throws Exception { assertContextExpectationFails(s -> s.subscriberContext(Context.of("foo", "bar", "foobar", "baz")), e -> e.containsAllOf(Context.of("foo", "bar", "other", "stuff"))) .withMessage("Expected Context Context2{foo=bar, foobar=baz} to contain all " + "of Context2{foo=bar, other=stuff}"); }
@Test public void containsAllOfContext() throws Exception { assertContextExpectation(s -> s.subscriberContext(Context.of("foo", "bar", "foobar", "baz")), e -> e.containsAllOf(Context.of("foo", "bar"))); }