@Test void testGetCommonNameWhenTheEndpointNameIsLessThan17AndEnvNameLessThan8Chars() { String endpointName = "test-cl-master0"; String envName = "shrt-nv"; String accountName = "xcu2-8y8x"; String rootDomain = "wl.cloudera.site"; ReflectionTestUtils.setField(underTest, "rootDomain", rootDomain); String commonName = underTest.getCommonName(endpointName, envName, accountName); String expected = String.format("bbd9025ff9fd7c4d.%s.%s.%s", envName, accountName, rootDomain); assertEquals(expected, commonName); }
public String getCommonName(String endpointName, String environmentName, String accountName) { String domain = getDomainName(environmentName, accountName); String uniqueNameToBeHashed = endpointName + environmentName; String clusterHash = sipHash24().hashUnencodedChars(uniqueNameToBeHashed).toString(); return clusterHash + DOMAIN_PART_DELIMITER + domain; }
EnvironmentBasedDomainNameProvider { public String getCommonName(String endpointName, String environmentName, String accountName) { String domain = getDomainName(environmentName, accountName); String uniqueNameToBeHashed = endpointName + environmentName; String clusterHash = sipHash24().hashUnencodedChars(uniqueNameToBeHashed).toString(); return clusterHash + DOMAIN_PART_DELIMITER + domain; } }
EnvironmentBasedDomainNameProvider { public String getCommonName(String endpointName, String environmentName, String accountName) { String domain = getDomainName(environmentName, accountName); String uniqueNameToBeHashed = endpointName + environmentName; String clusterHash = sipHash24().hashUnencodedChars(uniqueNameToBeHashed).toString(); return clusterHash + DOMAIN_PART_DELIMITER + domain; }  }
EnvironmentBasedDomainNameProvider { public String getCommonName(String endpointName, String environmentName, String accountName) { String domain = getDomainName(environmentName, accountName); String uniqueNameToBeHashed = endpointName + environmentName; String clusterHash = sipHash24().hashUnencodedChars(uniqueNameToBeHashed).toString(); return clusterHash + DOMAIN_PART_DELIMITER + domain; }  String getDomainName(String environmentName, String accountName); String getFullyQualifiedEndpointName(String endpointName, String environmentName, String accountName); String getCommonName(String endpointName, String environmentName, String accountName); }
EnvironmentBasedDomainNameProvider { public String getCommonName(String endpointName, String environmentName, String accountName) { String domain = getDomainName(environmentName, accountName); String uniqueNameToBeHashed = endpointName + environmentName; String clusterHash = sipHash24().hashUnencodedChars(uniqueNameToBeHashed).toString(); return clusterHash + DOMAIN_PART_DELIMITER + domain; }  String getDomainName(String environmentName, String accountName); String getFullyQualifiedEndpointName(String endpointName, String environmentName, String accountName); String getCommonName(String endpointName, String environmentName, String accountName);  }