@Test public void testGetPurlBuilder() throws Exception { String expectedUrl = "https: URIBuilder actualBuilder = (URIBuilder) ReflectionUtil.callStatic(ETLUtil.class, "getPurlBuilder", new Object[] {}); assertNotNull("01",actualBuilder); assertEquals("02",expectedUrl, actualBuilder.toString()); }
private static URIBuilder getPurlBuilder() { String value = null; try { value = DaoRegistry.getInstance().getConfiguration().get("purl.baseurl"); if (value == null || value.trim().isEmpty()) { value = PURL_SERVER_BASE_URL; } return new URIBuilder(value); } catch (URISyntaxException e) { String fmt = "Could not create URIBuilder for PURL base URL \"%s\": %s"; String msg = String.format(fmt, value, e.getMessage()); throw new ETLRuntimeException(msg); } }
ETLUtil { private static URIBuilder getPurlBuilder() { String value = null; try { value = DaoRegistry.getInstance().getConfiguration().get("purl.baseurl"); if (value == null || value.trim().isEmpty()) { value = PURL_SERVER_BASE_URL; } return new URIBuilder(value); } catch (URISyntaxException e) { String fmt = "Could not create URIBuilder for PURL base URL \"%s\": %s"; String msg = String.format(fmt, value, e.getMessage()); throw new ETLRuntimeException(msg); } } }
ETLUtil { private static URIBuilder getPurlBuilder() { String value = null; try { value = DaoRegistry.getInstance().getConfiguration().get("purl.baseurl"); if (value == null || value.trim().isEmpty()) { value = PURL_SERVER_BASE_URL; } return new URIBuilder(value); } catch (URISyntaxException e) { String fmt = "Could not create URIBuilder for PURL base URL \"%s\": %s"; String msg = String.format(fmt, value, e.getMessage()); throw new ETLRuntimeException(msg); } } ETLUtil(); }
ETLUtil { private static URIBuilder getPurlBuilder() { String value = null; try { value = DaoRegistry.getInstance().getConfiguration().get("purl.baseurl"); if (value == null || value.trim().isEmpty()) { value = PURL_SERVER_BASE_URL; } return new URIBuilder(value); } catch (URISyntaxException e) { String fmt = "Could not create URIBuilder for PURL base URL \"%s\": %s"; String msg = String.format(fmt, value, e.getMessage()); throw new ETLRuntimeException(msg); } } ETLUtil(); static Throwable getRootCause(Throwable t); static void logDuration(Logger logger, Class<?> cls, long start); static String getDuration(long start); static String getDuration(long start, long end); static String getSpecimenPurl(String unitID); static Logger getLogger(Class<?> forClass); static void truncate(DocumentType<T> dt); static void truncate(DocumentType<T> dt, SourceSystem ss); static String[] getTestGenera(); }
ETLUtil { private static URIBuilder getPurlBuilder() { String value = null; try { value = DaoRegistry.getInstance().getConfiguration().get("purl.baseurl"); if (value == null || value.trim().isEmpty()) { value = PURL_SERVER_BASE_URL; } return new URIBuilder(value); } catch (URISyntaxException e) { String fmt = "Could not create URIBuilder for PURL base URL \"%s\": %s"; String msg = String.format(fmt, value, e.getMessage()); throw new ETLRuntimeException(msg); } } ETLUtil(); static Throwable getRootCause(Throwable t); static void logDuration(Logger logger, Class<?> cls, long start); static String getDuration(long start); static String getDuration(long start, long end); static String getSpecimenPurl(String unitID); static Logger getLogger(Class<?> forClass); static void truncate(DocumentType<T> dt); static void truncate(DocumentType<T> dt, SourceSystem ss); static String[] getTestGenera();  }