@@ -0,0 +1,1152 @@
+package com.continuuity.passport.utils;%0A%0Aimport org.junit.Test;%0A%0Aimport java.net.MalformedURLException;%0Aimport java.net.URI;%0Aimport java.net.URISyntaxException;%0A%0A/**%0A *%0A */%0Apublic class TestURI %7B%0A%0A  @Test%0A  public void testUri() throws URISyntaxException, MalformedURLException %7B%0A    URI uri  = new URI (%22http://foo.bar.com%22);%0A    URI appendedUri = getAppendedURI(uri,%22/path/to/baz%22);%0A%0A    assert(appendedUri.toURL().toString().equals(%22http://foo.bar.com/path/to/baz%22));%0A%0A  %7D%0A%0A  @Test%0A  public void testUriWithQueryParam() throws URISyntaxException, MalformedURLException %7B%0A    URI uri  = new URI (%22http://foo.bar.com?query=param%22);%0A    URI appendedUri =  getAppendedURI(uri, %22query=param%22);%0A    assert(appendedUri.toURL().toString().equals(%22http://foo.bar.com/path/to/baz?query=param%22));%0A  %7D%0A%0A  public URI getAppendedURI(URI uri, String relativePath) throws MalformedURLException, URISyntaxException %7B%0A    if (uri.getQuery() !=null && uri.getQuery().isEmpty())%7B%0A      return new URI(String.format(%22%25s/%25s%22,uri.toURL(),relativePath));%0A    %7D%0A    else %7B%0A      return new URI(String.format(%22%25s/%25s?%25s%22,uri.toURL(),relativePath,uri.getQuery()));%0A    %7D%0A  %7D%0A%7D%0A

Add test case for URI