Holiday extends OrmActiveMetaRecord<Holiday> { public static Optional<Holiday> get(final OrmRepository rep, LocalDate day) { return get(rep, day, CategoryDefault); }  static Optional<Holiday> get(final OrmRepository rep, LocalDate day); static Optional<Holiday> get(final OrmRepository rep, LocalDate day, String category); static Holiday load(final OrmRepository rep, LocalDate day); static Holiday load(final OrmRepository rep, LocalDate day, String category); static List<Holiday> find(final OrmRepository rep, final int year); static List<Holiday> find(final OrmRepository rep, final int year, final String category); static void register(final OrmRepository rep, final RegHoliday p); static final String CategoryDefault; }
@Test public void 休日を取得する() { tx(() -> { Optional<Holiday> day = Holiday.get(rep, LocalDate.of(2015, 9, 22)); assertTrue(day.isPresent()); assertThat(day.get().getDay(), is(LocalDate.of(2015, 9, 22))); }