HttpUtil { public static String convertUriToHttps(String uri) throws URISyntaxException{ URI sourceUri = new URI(uri); URI convertedUri = convertUriToHttps(sourceUri); String strConvertedUri = convertedUri.toString(); return strConvertedUri; }  static String getDateAsHttpDate(Date date); static String convertUriToHttps(String uri); static URI convertUriToHttps(URI uri); static String fetchDataFromUri(String endpoint); static BufferedImage fetchImageFromUri(String endpoint);  }
@Test public void testConvertGoodHttpUriToHttps_String() throws Exception { assertEquals(goodHttpsUriStr, HttpUtil.convertUriToHttps(goodHttpUriStr)); }
@Test public void testConvertGoodHttpsUriToHttps_String() throws Exception { assertEquals(goodHttpsUriStr, HttpUtil.convertUriToHttps(goodHttpsUriStr)); }
@Test(expected = URISyntaxException.class) public void testConvertBadUri() throws Exception { HttpUtil.convertUriToHttps(badUriStr); }
@Test public void testConvertGoodHttpUriToHttps_URI() throws Exception { assertEquals(goodHttpsUri, HttpUtil.convertUriToHttps(goodHttpUri)); }
@Test public void testConvertGoodHttpsUriToHttps_URI() throws Exception { URI actual = HttpUtil.convertUriToHttps(goodHttpsUri); assertFalse("the method should return a copy of the parameterized uri rather than modifying it", goodHttpsUri == actual); assertEquals(goodHttpsUri, actual); }