private List<Logs> dailyLog(String channelName, DateTime date) { Channel channel = channelDao.get(channelName); List<Logs> list = null; if (channel.getLogged()) { DateTime start = (date == null ? new DateTime(DateTimeZone.forID("US/Eastern")) : date) .withTimeAtStartOfDay(); DateTime tomorrow = start.plusDays(1); LogsCriteria criteria = new LogsCriteria(ds); criteria.channel().equal(channelName); criteria.and( criteria.updated().greaterThanOrEq(start), criteria.updated().lessThanOrEq(tomorrow)); list = criteria.query().asList(); } return list; }
@Test(dependsOnMethods = {"verify"}) public void logs() { LogsCriteria criteria = new LogsCriteria(ds); criteria.message().contains("read that book"); Assert.assertNotNull(criteria.query().get()); }