protected void testTempUrl(final String method, final LocalTime localTime) { final String password = "******"; final long todayInMS = 1369581129861L; final long oneDayInSeconds = 86400L; final long tomorrowInSeconds = todayInMS / 1000 + oneDayInSeconds; final AbstractStoredObject object = createStoredObjectForTempURL(password); // Make sure that a fixed date is used useFixedDateForToday(todayInMS); // Check whether the secure URL contains the right signature and expiry date final String secureUrl; if (method.equals("GET")) { secureUrl = object.getTempGetUrl(oneDayInSeconds); } else { secureUrl = object.getTempPutUrl(oneDayInSeconds); } assertTrue( "Does not contain the timestamp of 'tomorrow'", secureUrl.contains(Long.toString(tomorrowInSeconds))); String plainText = method + "\n" + tomorrowInSeconds + "\n/internal/path/alpha/some-image.jpg"; String signature = HashSignature.getSignature(password, plainText); assertTrue("The signature of the secure URL", secureUrl.contains(signature)); }