### Question:
S3QueryStringSigner extends AbstractAWSSigner { @Override public void sign(Request<?> request, AWSCredentials credentials) { AWSCredentials sanitizedCredentials = sanitizeCredentials(credentials); if (sanitizedCredentials instanceof AWSSessionCredentials) { addSessionCredentials(request, (AWSSessionCredentials) sanitizedCredentials); } String expirationInSeconds = Long.toString(expiration.getTime() / TIME_TO_SECONDS); String canonicalString = RestUtils.makeS3CanonicalString( httpVerb, resourcePath, request, expirationInSeconds); String signature = super.signAndBase64Encode(canonicalString, sanitizedCredentials.getAWSSecretKey(), SigningAlgorithm.HmacSHA1); request.addParameter("AWSAccessKeyId", sanitizedCredentials.getAWSAccessKeyId()); request.addParameter("Expires", expirationInSeconds); request.addParameter("Signature", signature); } S3QueryStringSigner(String httpVerb, String resourcePath, Date expiration); @Override void sign(Request<?> request, AWSCredentials credentials);  }### Answer:
@Test public void testSign() throws URISyntaxException { final S3QueryStringSigner signer = new S3QueryStringSigner("GET", "/test-bucket123456/TestFile.txt", new Date(1431377237312L)); final GetObjectRequest gr = new GetObjectRequest("test-bucket123456", "TestFile.txt"); final Request<?> req = new DefaultRequest(gr, Constants.S3_SERVICE_DISPLAY_NAME); req.setHttpMethod(HttpMethodName.GET); req.setResourcePath("TestFile.txt"); req.setEndpoint(new URI("https: signer.sign(req, new BasicAWSCredentials( "AKIAJD11BOGUS11ACCESS11KEYXMGOZQ", "LYd/ZD4F11BOGUS11SECRET11KEYOM1SiD6")); assertEquals( "https: ServiceUtils.convertRequestToUrl(req, true).toString()); }