### Question:
OathTokenCode { public int getProgress() { long cur = timeKeeper.getCurrentTimeMillis(); long total = until - start; long state = cur - start; int progress = (int) (state * MAX_VALUE / total); return progress < MAX_VALUE ? progress : MAX_VALUE; } protected  OathTokenCode(TimeKeeper timeKeeper, String code, long start, long until, OathMechanism.TokenType tokenType); String getCurrentCode(); long getStart(); long getUntil(); boolean isValid(); OathMechanism.TokenType getOathType(); int getProgress();  }### Answer:
@Test public void testShouldReportProgressBeforeExpiry() { assertEquals(oathTokenCode.getProgress(), 0); timeKeeper.timeTravel(EXPIRY_DELAY / 4); assertEquals(oathTokenCode.getProgress(), 250); timeKeeper.timeTravel(EXPIRY_DELAY / 4); assertEquals(oathTokenCode.getProgress(), 500); timeKeeper.timeTravel(EXPIRY_DELAY / 4); assertEquals(oathTokenCode.getProgress(), 750); timeKeeper.timeTravel(EXPIRY_DELAY / 4); assertEquals(oathTokenCode.getProgress(), 1000); }
@Test public void testShouldReportFullProgressAfterExpiry() { timeKeeper.timeTravel(EXPIRY_DELAY * 2); assertEquals(oathTokenCode.getProgress(), 1000); }