SdkHttpUtils { public static String appendUri(String baseUri, String path) { return appendUri(baseUri, path, false); }  static String urlEncode(final String value, final boolean path); static String urlDecode(final String value); static boolean isUsingNonDefaultPort(URI uri); static boolean usePayloadForQueryParameters(SignableRequest<?> request); static String encodeParameters(SignableRequest<?> request); static String appendUri(String baseUri, String path); static String appendUri(final String baseUri, String path, final boolean escapeDoubleSlash);  }
@Test public void testAppendUriNoPath() { String host = "foo.com/"; String resourcePath = ""; Assert.assertEquals(SdkHttpUtils.appendUri(host, resourcePath, true), "foo.com/"); }
@Test public void testAppendUriNoPathTrailingSlashAdded() { String host = "foo.com"; String resourcePath = ""; Assert.assertEquals(SdkHttpUtils.appendUri(host, resourcePath, true), "foo.com/"); }
@Test public void testAppendUriTrimExtraHostTrailingSlash() { String host = "foo.com/"; String resourcePath = "bar"; Assert.assertEquals(SdkHttpUtils.appendUri(host, resourcePath, true), "foo.com/bar"); }
@Test public void testAppendUriEscapeDoubleSlash() { String host = "foo.com"; String resourcePath = "aws Assert.assertEquals(SdkHttpUtils.appendUri(host, resourcePath, true), "foo.com/aws/%2Fjava/sdk"); }
@Test public void testAppendUriNoEscapeDoubleSlash() { String host = "foo.com"; String resourcePath = "aws Assert.assertEquals(SdkHttpUtils.appendUri(host, resourcePath, false), "foo.com/aws }