@Test public void customMatcherShouldBeAccepted() throws Exception { AtomicBoolean matcherCalled = new AtomicBoolean(); FixtureAssert.assertThat(new Entity(10, LocalDateTime.now())) .matchesExactly(overriddenMatchers("createdAt", new BaseMatcher<LocalDateTime>() { @Override public boolean matches(Object item) { matcherCalled.set(true); LocalDateTime actual = LocalDateTime.parse(String.valueOf(item)); LocalDateTime before = actual.minusMinutes(1); LocalDateTime after = actual.plusMinutes(1); return actual.isBefore(after) && actual.isAfter(before); } @Override public void describeTo(Description description) { } }), "customMatcherShouldBeAccepted-result"); assertThat(matcherCalled.get()).isTrue(); }
public static PropertyMatchers overriddenMatchers(String property, Matcher matcher) { return new PropertyMatchers(newHashSet(entryOf(property, matcher))); }
PropertyMatchers { public static PropertyMatchers overriddenMatchers(String property, Matcher matcher) { return new PropertyMatchers(newHashSet(entryOf(property, matcher))); } }
PropertyMatchers { public static PropertyMatchers overriddenMatchers(String property, Matcher matcher) { return new PropertyMatchers(newHashSet(entryOf(property, matcher))); } private  PropertyMatchers(Map<String, Matcher> matchers); private  PropertyMatchers(Set<Map.Entry<String, Matcher>> matcherEntries); }
PropertyMatchers { public static PropertyMatchers overriddenMatchers(String property, Matcher matcher) { return new PropertyMatchers(newHashSet(entryOf(property, matcher))); } private  PropertyMatchers(Map<String, Matcher> matchers); private  PropertyMatchers(Set<Map.Entry<String, Matcher>> matcherEntries); static PropertyMatchers overriddenMatchers(String property, Matcher matcher); static PropertyMatchers overriddenMatchers(String p1, Matcher m1, String p2, Matcher m2); static PropertyMatchers overriddenMatchers(String p1,
                                                      Matcher m1,
                                                      String p2,
                                                      Matcher m2,
                                                      String p3,
                                                      Matcher m3); static PropertyMatchers overriddenMatchers(String p1,
                                                      Matcher m1,
                                                      String p2,
                                                      Matcher m2,
                                                      String p3,
                                                      Matcher m3,
                                                      String p4,
                                                      Matcher m4); static PropertyMatchers overriddenMatchers(String p1,
                                                      Matcher m1,
                                                      String p2,
                                                      Matcher m2,
                                                      String p3,
                                                      Matcher m3,
                                                      String p4,
                                                      Matcher m4,
                                                      String p5,
                                                      Matcher m5); static PropertyMatchers overriddenMatchers(String p1,
                                                      Matcher m1,
                                                      String p2,
                                                      Matcher m2,
                                                      String p3,
                                                      Matcher m3,
                                                      String p4,
                                                      Matcher m4,
                                                      String p5,
                                                      Matcher m5,
                                                      Object... additionalMatchers); boolean isEmpty(); Set<String> getProperties(); Matcher getMatcher(String property); }
PropertyMatchers { public static PropertyMatchers overriddenMatchers(String property, Matcher matcher) { return new PropertyMatchers(newHashSet(entryOf(property, matcher))); } private  PropertyMatchers(Map<String, Matcher> matchers); private  PropertyMatchers(Set<Map.Entry<String, Matcher>> matcherEntries); static PropertyMatchers overriddenMatchers(String property, Matcher matcher); static PropertyMatchers overriddenMatchers(String p1, Matcher m1, String p2, Matcher m2); static PropertyMatchers overriddenMatchers(String p1,
                                                      Matcher m1,
                                                      String p2,
                                                      Matcher m2,
                                                      String p3,
                                                      Matcher m3); static PropertyMatchers overriddenMatchers(String p1,
                                                      Matcher m1,
                                                      String p2,
                                                      Matcher m2,
                                                      String p3,
                                                      Matcher m3,
                                                      String p4,
                                                      Matcher m4); static PropertyMatchers overriddenMatchers(String p1,
                                                      Matcher m1,
                                                      String p2,
                                                      Matcher m2,
                                                      String p3,
                                                      Matcher m3,
                                                      String p4,
                                                      Matcher m4,
                                                      String p5,
                                                      Matcher m5); static PropertyMatchers overriddenMatchers(String p1,
                                                      Matcher m1,
                                                      String p2,
                                                      Matcher m2,
                                                      String p3,
                                                      Matcher m3,
                                                      String p4,
                                                      Matcher m4,
                                                      String p5,
                                                      Matcher m5,
                                                      Object... additionalMatchers); boolean isEmpty(); Set<String> getProperties(); Matcher getMatcher(String property);  }