use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.InstanceMetadataType.GATEWAY in project cloudbreak by hortonworks.
the class AllHostPublicDnsEntryServiceTest method getComponentLocationWhenTheGatewayNodeHaveOnlyDiscoveryFQDN.
@Test
void getComponentLocationWhenTheGatewayNodeHaveOnlyDiscoveryFQDN() {
Stack stack = TestUtil.stack();
InstanceMetaData primaryGatewayInstance = stack.getPrimaryGatewayInstance();
stack.getNotTerminatedAndNotZombieInstanceMetaDataList().stream().filter(im -> !primaryGatewayInstance.getId().equals(im.getId())).forEach(im -> im.setDiscoveryFQDN(null));
Map<String, List<String>> result = underTest.getComponentLocation(stack);
Assertions.assertTrue(result.isEmpty(), "Result couldn't contain any hostname as nodes do not have discovery FQDN except gateway");
}
Aggregations