FormSigner implements HttpRequestFilter, RequestSigner { @VisibleForTesting String buildCanonicalizedString(Multimap<String, String> decodedParams) { return encodeQueryLine(TreeMultimap.create(decodedParams), ImmutableList.<Character> of()); } @Inject  FormSigner(SignatureWire signatureWire, @ApiVersion String apiVersion,
         @org.jclouds.location.Provider Supplier<Credentials> creds, @TimeStamp Provider<String> dateService,
         Crypto crypto, HttpUtils utils); HttpRequest filter(HttpRequest request); @VisibleForTesting String sign(String toSign); @VisibleForTesting String createStringToSign(HttpRequest request, Multimap<String, String> decodedParams); String createStringToSign(HttpRequest input); static final Set<String> mandatoryParametersForSignature; }
@Test void testBuildCanonicalizedString() { assertEquals( staticCredentialsFilter.buildCanonicalizedString(new ImmutableMultimap.Builder<String, String>() .put("AWSAccessKeyId", "foo").put("Action", "DescribeImages").put("Expires", "2008-02-10T12:00:00Z") .put("ImageId.1", "ami-2bb65342").put("SignatureMethod", "HmacSHA256").put("SignatureVersion", "2") .put("Version", "2010-06-15").build()), "AWSAccessKeyId=foo&Action=DescribeImages&Expires=2008-02-10T12%3A00%3A00Z&ImageId.1=ami-2bb65342&SignatureMethod=HmacSHA256&SignatureVersion=2&Version=2010-06-15"); }