LdapAutodiscovery { public static String getDnsDomainDn(String domain) { StringBuilder result = new StringBuilder(); String[] domainPart = domain.split("[.]"); for (int i = 0; i < domainPart.length; i++) { result.append(i > 0 ? "," : "").append("dc=").append(domainPart[i]); } return result.toString(); }  static String getDnsDomainName(); static String getDnsDomainName(String fqdn); static String getDnsDomainDn(String domain); List<LdapSrvRecord> getLdapServers(String domain);  }
@Test public void testGetDnsDomainDn() { assertThat(LdapAutodiscovery.getDnsDomainDn("example.org")).isEqualTo("dc=example,dc=org"); }