@Test(expected = URISyntaxException.class) public void testGetUri() throws Exception { ETLStatistics etlStatistics = new ETLStatistics(); BrahmsMultiMediaTransformer brahmsMultiMediaTransformer = new BrahmsMultiMediaTransformer(etlStatistics); String urlStr = "http: String urlStrEncoded = "http: URI uriExpected = new URI(urlStrEncoded); Object obj = CommonReflectionUtil.callMethod(urlStr, String.class, brahmsMultiMediaTransformer, "getUri"); URI uriActual = (URI) obj; assertEquals("01", uriActual, uriExpected); urlStr = "http: urlStrEncoded = new String(urlStr); uriExpected = new URI(urlStrEncoded); obj = CommonReflectionUtil.callMethod(urlStr, String.class, brahmsMultiMediaTransformer, "getUri"); uriActual = (URI) obj; assertEquals("02", uriActual, uriExpected); urlStr = "http: urlStrEncoded = new String(urlStr); uriExpected = new URI(urlStrEncoded); obj = CommonReflectionUtil.callMethod(urlStr, String.class, brahmsMultiMediaTransformer, "getUri"); uriActual = (URI) obj; assertEquals("03", uriActual, uriExpected); String illegalUriStr = "&#12288;quatsch&#12288;"; try { obj = CommonReflectionUtil.callMethod(illegalUriStr, String.class, brahmsMultiMediaTransformer, "getUri"); uriActual = (URI) obj; System.out.println(uriActual.toString()); } catch (InvocationTargetException e) { if (e.getCause() instanceof URISyntaxException) throw new URISyntaxException(illegalUriStr, e.getCause().getMessage()); } }
private static URI getUri(String url) throws URISyntaxException { url = url.trim().replaceAll(" ", "%20"); return new URI(url); }
BrahmsMultiMediaTransformer extends BrahmsTransformer<MultiMediaObject> { private static URI getUri(String url) throws URISyntaxException { url = url.trim().replaceAll(" ", "%20"); return new URI(url); } }
BrahmsMultiMediaTransformer extends BrahmsTransformer<MultiMediaObject> { private static URI getUri(String url) throws URISyntaxException { url = url.trim().replaceAll(" ", "%20"); return new URI(url); } BrahmsMultiMediaTransformer(ETLStatistics stats); }
BrahmsMultiMediaTransformer extends BrahmsTransformer<MultiMediaObject> { private static URI getUri(String url) throws URISyntaxException { url = url.trim().replaceAll(" ", "%20"); return new URI(url); } BrahmsMultiMediaTransformer(ETLStatistics stats);  }
BrahmsMultiMediaTransformer extends BrahmsTransformer<MultiMediaObject> { private static URI getUri(String url) throws URISyntaxException { url = url.trim().replaceAll(" ", "%20"); return new URI(url); } BrahmsMultiMediaTransformer(ETLStatistics stats);   }