use of com.sequenceiq.cloudbreak.cloud.azure.validator.privatedns.PrivateDnsZoneValidationTestConstants.TestPagedList in project cloudbreak by hortonworks.
the class AzurePrivateDnsZoneValidatorServiceTest method testPrivateDnsZonesNotConnectedToNetworkWhenNoZonesFound.
@Test
void testPrivateDnsZonesNotConnectedToNetworkWhenNoZonesFound() {
ValidationResult.ValidationResultBuilder resultBuilder = ValidationResult.builder();
PagedList<PrivateZone> privateDnsZoneList = new TestPagedList<>();
ValidationResult result = underTest.privateDnsZonesNotConnectedToNetwork(azureClient, NETWORK_NAME, A_RESOURCE_GROUP_NAME, ZONE_NAME_POSTGRES, resultBuilder, privateDnsZoneList);
assertFalse(result.hasError());
verify(azureClient, never()).getNetworkLinkByPrivateDnsZone(anyString(), anyString(), anyString());
}
use of com.sequenceiq.cloudbreak.cloud.azure.validator.privatedns.PrivateDnsZoneValidationTestConstants.TestPagedList in project cloudbreak by hortonworks.
the class AzurePrivateDnsZoneValidatorServiceTest method getNetworkLinks.
private PagedList<VirtualNetworkLinkInner> getNetworkLinks(List<String> foundNetworkIds) {
PagedList<VirtualNetworkLinkInner> virtualNetworkLinks = new TestPagedList<>();
foundNetworkIds.stream().map(id -> new VirtualNetworkLinkInner().withVirtualNetwork(new SubResource().withId(id))).forEach(virtualNetworkLinks::add);
return virtualNetworkLinks;
}
use of com.sequenceiq.cloudbreak.cloud.azure.validator.privatedns.PrivateDnsZoneValidationTestConstants.TestPagedList in project cloudbreak by hortonworks.
the class AzurePrivateDnsZoneValidatorServiceTest method testPrivateDnsZoneExistsWhenZoneExists.
@Test
void testPrivateDnsZoneExistsWhenZoneExists() {
ValidationResult.ValidationResultBuilder resultBuilder = ValidationResult.builder();
PagedList<PrivateZone> privateZones = new TestPagedList<>();
privateZones.add(getPrivateDnsZone(null, ZONE_NAME_POSTGRES, null));
when(azureClient.getPrivateDnsZonesByResourceGroup(SUBSCRIPTION_ID, SINGLE_RESOURCE_GROUP_NAME)).thenReturn(privateZones);
resultBuilder = underTest.privateDnsZoneExists(azureClient, getPrivateDnsZoneResourceId(), resultBuilder);
ValidationResult result = resultBuilder.build();
assertFalse(result.hasError());
}
Aggregations