IsDateInMonth extends TypeSafeMatcher<Date> { @Override public void describeTo(final Description description) { description.appendText("a date with id ").appendValue(month); } IsDateInMonth(final int month); static Matcher<Date> january(); static Matcher<Date> february(); static Matcher<Date> march(); static Matcher<Date> april(); static Matcher<Date> may(); static Matcher<Date> june(); static Matcher<Date> july(); static Matcher<Date> august(); static Matcher<Date> september(); static Matcher<Date> october(); static Matcher<Date> november(); static Matcher<Date> december(); @Override void describeTo(final Description description);  }
@Test public void testDescribeTo() throws Exception { BaseMatcherTest.assertIsDescribedTo("a date with id <JANUARY>", januaryMatcher); BaseMatcherTest.assertIsDescribedTo("a date with id <FEBRUARY>", februaryMatcher); BaseMatcherTest.assertIsDescribedTo("a date with id <MARCH>", marchMatcher); BaseMatcherTest.assertIsDescribedTo("a date with id <APRIL>", aprilMatcher); BaseMatcherTest.assertIsDescribedTo("a date with id <MAY>", mayMatcher); BaseMatcherTest.assertIsDescribedTo("a date with id <JUNE>", juneMatcher); BaseMatcherTest.assertIsDescribedTo("a date with id <JULY>", julyMatcher); BaseMatcherTest.assertIsDescribedTo("a date with id <AUGUST>", augustMatcher); BaseMatcherTest.assertIsDescribedTo("a date with id <SEPTEMBER>", septemberMatcher); BaseMatcherTest.assertIsDescribedTo("a date with id <OCTOBER>", octoberMatcher); BaseMatcherTest.assertIsDescribedTo("a date with id <NOVEMBER>", novemberMatcher); BaseMatcherTest.assertIsDescribedTo("a date with id <DECEMBER>", decemberMatcher); }