CrlDao { public boolean isCrlOlderThan24Hours() { return System.currentTimeMillis() >= lastUpdate + 24 * 60 * 60 * 1000; } CrlDao(X509CRL crl, long currentTimeMillis); boolean isCrlOlderThan24Hours();  }
@Test @DisplayName("returns false when last CRL update was within 24 hours") void crlIsNotOlderThan24HoursReturnFalse() { X509CRL x509CRLMock = Mockito.mock(X509CRL.class); CrlDao crlDao = new CrlDao(x509CRLMock, LAST_UPDATE_TIME_WITHIN_24H); boolean isCrlOlderThan24Hours = crlDao.isCrlOlderThan24Hours(); Assertions.assertFalse(isCrlOlderThan24Hours); }
@Test @DisplayName("returns true when last CRL update was within 24 hours") void crlIsOlderThan24HoursReturnTrue() { X509CRL x509CRLMock = Mockito.mock(X509CRL.class); CrlDao crlDao = new CrlDao(x509CRLMock, LAST_UPDATE_TIME_OLDER_24H); boolean isCrlOlderThan24Hours = crlDao.isCrlOlderThan24Hours(); Assertions.assertTrue(isCrlOlderThan24Hours); }