SharedKeyLiteAuthentication implements HttpRequestFilter { public HttpRequest filter(HttpRequest request) throws HttpException { request = replaceDateHeader(request); String signature = calculateSignature(createStringToSign(request)); request = replaceAuthorizationHeader(request, signature); utils.logRequest(signatureLog, request, "<<"); return request; } @Inject  SharedKeyLiteAuthentication(SignatureWire signatureWire,
         @org.jclouds.location.Provider Supplier<Credentials> creds, @TimeStamp Provider<String> timeStampProvider,
         Crypto crypto, HttpUtils utils); HttpRequest filter(HttpRequest request); String createStringToSign(HttpRequest request); String signString(String toSign);  }
@Test(threadPoolSize = 3, dataProvider = "dataProvider", timeOut = 3000) void testIdempotent(HttpRequest request) { request = filter.filter(request); String signature = request.getFirstHeaderOrNull(HttpHeaders.AUTHORIZATION); String date = request.getFirstHeaderOrNull(HttpHeaders.DATE); int iterations = 1; while (request.getFirstHeaderOrNull(HttpHeaders.DATE).equals(date)) { date = request.getFirstHeaderOrNull(HttpHeaders.DATE); iterations++; assertEquals(signature, request.getFirstHeaderOrNull(HttpHeaders.AUTHORIZATION)); request = filter.filter(request); } System.out.printf("%s: %d iterations before the timestamp updated %n", Thread.currentThread().getName(), iterations); }