コード例 #1
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);
 }
コード例 #2
0
 private void verifyUpgradeResponse(UpgradeResponse response) {
   assertEquals("Response format incorrect.", RESPONSE_FORMAT, response.getResponseFormat());
   assertEquals("Latest version incorrect.", LATEST_VERSION, response.getLatestVersion());
   assertEquals(
       "Latest version URL incorrect.",
       LATEST_VERSION_URL,
       response.getLatestVersionURL().toString());
   assertEquals(
       "Compatible version incorrect.", COMPATIBLE_VERSION, response.getCompatibleVersion());
   assertEquals(
       "Compatible version URL incorrect.",
       COMPATIBLE_VERSION_URL,
       response.getCompatibleVersionURL().toString());
   assertEquals("Upgrade message incorrect.", UPGRADE_MESSAGE, response.getMessage());
   assertEquals("Last reminder time incorrect.", 0L, response.getLastReminderTimeMillis());
 }