ImageStoreUtil { public static String generatePostUploadUrl(String ssvmUrlDomain, String ipAddress, String uuid) { String hostname = ipAddress; if(StringUtils.isNotBlank(ssvmUrlDomain)) { hostname = ipAddress.replace(".", "-"); hostname = hostname + ssvmUrlDomain.substring(1); } return "https: }  static String generatePostUploadUrl(String ssvmUrlDomain, String ipAddress, String uuid); static String checkTemplateFormat(String path, String uripath); static final Logger s_logger; }
@Test public void testgeneratePostUploadUrl() throws MalformedURLException { String ssvmdomain = "*.realhostip.com"; String ipAddress = "10.147.28.14"; String uuid = UUID.randomUUID().toString(); String url = ImageStoreUtil.generatePostUploadUrl(null, ipAddress, uuid); assertPostUploadUrl(url, ipAddress, uuid); url = ImageStoreUtil.generatePostUploadUrl("", ipAddress, uuid); assertPostUploadUrl(url, ipAddress, uuid); url = ImageStoreUtil.generatePostUploadUrl(ssvmdomain, ipAddress, uuid); assertPostUploadUrl(url, ipAddress.replace(".", "-") + ssvmdomain.substring(1), uuid); }