### Question:
KerberosConfigRegisterService extends AbstractConfigRegister { @Override public void register(Long stackId) { createKerberosConfig(stackId, FREEIPA_DEFAULT_ADMIN, null, null, null); }  @Override void register(Long stackId); KerberosConfig createKerberosConfig(Long stackId, String dn, String password, String clusterName, String environmentCrn); @Override void delete(Stack stack); static final String FREEIPA_DEFAULT_ADMIN; }### Answer:
@Test void testRegister() { Stack stack = new Stack(); stack.setEnvironmentCrn("env"); stack.setAccountId("acc"); stack.setName("name"); stack.setAppVersion("2.20.0"); InstanceGroup instanceGroup = new InstanceGroup(); instanceGroup.setInstanceGroupType(InstanceGroupType.MASTER); InstanceMetaData instanceMetaData = new InstanceMetaData(); instanceMetaData.setDiscoveryFQDN("fqdn"); instanceMetaData.setPrivateIp("1.1.1.1"); instanceGroup.setInstanceMetaData(Collections.singleton(instanceMetaData)); stack.setInstanceGroups(Collections.singleton(instanceGroup)); when(stackService.getByIdWithListsInTransaction(anyLong())).thenReturn(stack); FreeIpa freeIpa = new FreeIpa(); freeIpa.setDomain("testdomain.local"); freeIpa.setAdminPassword("asdf"); when(freeIpaService.findByStackId(anyLong())).thenReturn(freeIpa); when(balancedDnsAvailabilityChecker.isBalancedDnsAvailable(stack)).thenReturn(true); underTest.register(1L); ArgumentCaptor<KerberosConfig> kerberosConfigArgumentCaptor = ArgumentCaptor.forClass(KerberosConfig.class); ArgumentCaptor<String> accountIdArgumentCaptor = ArgumentCaptor.forClass(String.class); verify(kerberosConfigService).createKerberosConfig(kerberosConfigArgumentCaptor.capture(), accountIdArgumentCaptor.capture()); assertEquals(stack.getAccountId(), accountIdArgumentCaptor.getValue()); KerberosConfig kerberosConfig = kerberosConfigArgumentCaptor.getValue(); assertEquals(stack.getName(), kerberosConfig.getName()); assertEquals(stack.getEnvironmentCrn(), kerberosConfig.getEnvironmentCrn()); assertEquals("kdc.testdomain.local", kerberosConfig.getUrl()); assertEquals("kerberos.testdomain.local", kerberosConfig.getAdminUrl()); assertEquals(instanceMetaData.getPrivateIp(), kerberosConfig.getNameServers()); assertEquals(freeIpa.getAdminPassword(), kerberosConfig.getPassword()); assertEquals(freeIpa.getDomain(), kerberosConfig.getDomain()); assertEquals(freeIpa.getDomain().toUpperCase(), kerberosConfig.getRealm()); assertEquals(KerberosType.FREEIPA, kerberosConfig.getType()); assertEquals(KerberosConfigRegisterService.FREEIPA_DEFAULT_ADMIN, kerberosConfig.getPrincipal()); }