@Before public void setUp() throws Exception { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.MILLISECOND, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.HOUR_OF_DAY, 0); today = calendar.getTime(); calendar.add(Calendar.DATE, -1); yesterday = calendar.getTime(); calendar.add(Calendar.DATE, +2); tomorrow = calendar.getTime(); member = new MockMemberImpl(); member.setPerson(PersonData.PERSON1); memberDao = new MockMemberDaoImpl(); memberDao.insertMember(member); service = new StatisticsServiceImpl(); service.setMemberDao(memberDao); }
@Test public void testMemberSubscriptionChangeTooNew() { member.setSubscriptionChangeDate(tomorrow); assertEquals(0, service.getStatistics(yesterday, today).getNumMembers()); }