@Test void testCreateOrUpdateCandidates() { Stack stack = new Stack(); stack.setEnvironmentCrn(ENVIRONMENT_CRN); Cluster cluster = new Cluster(); stack.setCluster(cluster); setInstanceGroups(stack); DetailedEnvironmentResponse environmentResponse = new DetailedEnvironmentResponse(); environmentResponse.setName(ENVIRONMENT_NAME); Map<String, List<String>> componentLocation = Map.of(NIFI_NODE, List.of(FQDN_1, FQDN_2, FQDN_3)); when(environmentClientService.getByCrn(stack.getEnvironmentCrn())).thenReturn(environmentResponse); when(componentLocatorService.getComponentLocation(stack.getCluster(), nifiConfigProvider.getRoleTypes())) .thenReturn(componentLocation); when(dnsManagementService.createOrUpdateDnsEntryWithIp(USER_CRN, ACCOUNT_ID, FQDN_1, ENVIRONMENT_NAME, false, List.of(PUBLIC_IP_1))).thenReturn(true); Map<String, String> result = underTest.createOrUpdateCandidates(stack, Map.of(FQDN_1, PUBLIC_IP_1)); assertEquals(1, result.size()); assertTrue(result.containsKey(FQDN_1)); assertEquals(PUBLIC_IP_1, result.get(FQDN_1)); }
public Map<String, String> createOrUpdateCandidates(Stack stack, Map<String, String> candidateAddressesByFqdn) { return doActionOnStack(stack, candidateAddressesByFqdn, this::createOrUpdateDnsEntries); }
BaseDnsEntryService extends BasePublicEndpointManagementService { public Map<String, String> createOrUpdateCandidates(Stack stack, Map<String, String> candidateAddressesByFqdn) { return doActionOnStack(stack, candidateAddressesByFqdn, this::createOrUpdateDnsEntries); } }
BaseDnsEntryService extends BasePublicEndpointManagementService { public Map<String, String> createOrUpdateCandidates(Stack stack, Map<String, String> candidateAddressesByFqdn) { return doActionOnStack(stack, candidateAddressesByFqdn, this::createOrUpdateDnsEntries); }  }
BaseDnsEntryService extends BasePublicEndpointManagementService { public Map<String, String> createOrUpdateCandidates(Stack stack, Map<String, String> candidateAddressesByFqdn) { return doActionOnStack(stack, candidateAddressesByFqdn, this::createOrUpdateDnsEntries); }  Map<String, String> createOrUpdate(Stack stack); Map<String, String> deregister(Stack stack); Map<String, String> createOrUpdateCandidates(Stack stack, Map<String, String> candidateAddressesByFqdn); Map<String, String> deregister(Stack stack, Map<String, String> candidateAddressesByFqdn); }
BaseDnsEntryService extends BasePublicEndpointManagementService { public Map<String, String> createOrUpdateCandidates(Stack stack, Map<String, String> candidateAddressesByFqdn) { return doActionOnStack(stack, candidateAddressesByFqdn, this::createOrUpdateDnsEntries); }  Map<String, String> createOrUpdate(Stack stack); Map<String, String> deregister(Stack stack); Map<String, String> createOrUpdateCandidates(Stack stack, Map<String, String> candidateAddressesByFqdn); Map<String, String> deregister(Stack stack, Map<String, String> candidateAddressesByFqdn);  }