Ejemplo n.º 1
0
 @Test
 public void testIsTimeToRemind() {
   LOG.info("Creating an upgrade response that's due for a reminder.");
   UpgradeResponse response = UpgradeResponse.fromJSON(TEST_JSON);
   assertTrue("It should be time to remind.", response.isTimeToRemind(1000L));
   LOG.info("Now we shouldn't be due for one.");
   response.justReminded();
   assertFalse("It shouldn't be time to remind.", response.isTimeToRemind(10000L));
 }
Ejemplo n.º 2
0
 @Test
 public void testJustReminded() {
   LOG.info("Creating an UpgradeResponse to remind the user about.");
   UpgradeResponse response = UpgradeResponse.fromJSON(TEST_JSON);
   assertEquals("Last reminder time incorrect.", 0L, response.getLastReminderTimeMillis());
   long currentTime = System.currentTimeMillis();
   LOG.info("Resetting last reminder time and verifying.");
   response.justReminded();
   assertTrue(
       "Last reminder time not updated correctly.",
       response.getLastReminderTimeMillis() >= currentTime);
 }