QueryStringSigner extends AbstractAWSSigner implements Signer { public void sign(SignableRequest<?> request, AWSCredentials credentials) throws SdkClientException { sign(request, SignatureVersion.V2, SigningAlgorithm.HmacSHA256, credentials); }  void sign(SignableRequest<?> request, AWSCredentials credentials); void sign(SignableRequest<?> request, SignatureVersion version,
            SigningAlgorithm algorithm, AWSCredentials credentials);  }
@Test public void testRequestResourcePath() throws Exception { SignableRequest<?> request = MockRequestBuilder.create() .withEndpoint("http: .withParameter("foo", "bar") .withPath("foo/bar") .build(); signer.sign(request, credentials); assertSignature(EXPECTED_SIGNATURE, request.getParameters()); }
@Test public void testRequestAndEndpointResourcePath() throws Exception { SignableRequest<?> request = MockRequestBuilder.create() .withEndpoint("http: .withParameter("foo", "bar") .withPath("/bar") .build(); signer.sign(request, credentials); assertSignature(EXPECTED_SIGNATURE, request.getParameters()); }
@Test public void testRequestAndEndpointResourcePathNoSlash() throws Exception { SignableRequest<?> request = MockRequestBuilder.create() .withEndpoint("http: .withParameter("foo", "bar") .withPath("bar") .build(); signer.sign(request, credentials); assertSignature(EXPECTED_SIGNATURE, request.getParameters()); }
@Test public void testAnonymous() throws Exception { SignableRequest<?> request = MockRequestBuilder.create() .withEndpoint("http: .withParameter("foo", "bar") .withPath("bar") .build(); signer.sign(request, new AnonymousAWSCredentials()); assertNull(request.getParameters().get("Signature")); }