예제 #1
0
 @Test
 public void verifyNullSignature(
     @Mocked(stubOutClassInitialization = true) final LocalTime localTime) {
   final AbstractStoredObject object = createStoredObjectForTempURL("welkom#42");
   assertFalse(
       "This signature is null and therefore invalid",
       object.verifyTempUrl("GET", null, 123456789));
 }
예제 #2
0
 protected boolean verifyTempURL(
     final LocalTime localTime, final String method, String plainText, long expiryInSeconds) {
   final String password = "******";
   final long todayInMS = 1369581129861L;
   final AbstractStoredObject object = createStoredObjectForTempURL(password);
   useFixedDateForToday(todayInMS);
   String signature = HashSignature.getSignature(password, plainText);
   return object.verifyTempUrl(method, signature, expiryInSeconds);
 }