use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.AzureNetworkV4Parameters in project cloudbreak by hortonworks.
the class NetworkV4BaseTest method testAzureNetworkPublicIpIsNotEmpty.
@Test
void testAzureNetworkPublicIpIsNotEmpty() {
AzureNetworkV4Parameters networkParameters = new AzureNetworkV4Parameters();
networkParameters.setNoPublicIp(true);
underTest.setAzure(networkParameters);
assertTrue(underTest.isNoPublicIp().get());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.AzureNetworkV4Parameters in project cloudbreak by hortonworks.
the class NetworkV1ToNetworkV4ConverterTest method createAzureNetworkV4Parameters.
private AzureNetworkV4Parameters createAzureNetworkV4Parameters() {
AzureNetworkV4Parameters p = new AzureNetworkV4Parameters();
p.setNetworkId("someNetworkId");
p.setNoPublicIp(true);
p.setSubnetId(SUBNET_ID);
p.setResourceGroupName("someResourceGroupName");
return p;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.AzureNetworkV4Parameters in project cloudbreak by hortonworks.
the class NetworkV1ToNetworkV4Converter method convertToAzureStackRequest.
private AzureNetworkV4Parameters convertToAzureStackRequest(Pair<AzureNetworkV1Parameters, EnvironmentNetworkResponse> source) {
EnvironmentNetworkResponse value = source.getValue();
AzureNetworkV1Parameters key = source.getKey();
AzureNetworkV4Parameters response = new AzureNetworkV4Parameters();
if (key != null) {
response.setNetworkId(value.getAzure().getNetworkId());
response.setNoPublicIp(value.getAzure().getNoPublicIp());
response.setResourceGroupName(value.getAzure().getResourceGroupName());
response.setDatabasePrivateDnsZoneId(value.getAzure().getDatabasePrivateDnsZoneId());
String subnetId = key.getSubnetId();
if (!Strings.isNullOrEmpty(subnetId)) {
response.setSubnetId(subnetId);
} else if (source.getValue() != null) {
response.setSubnetId(source.getValue().getPreferedSubnetId());
}
}
return response;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.AzureNetworkV4Parameters in project cloudbreak by hortonworks.
the class NetworkValidationServiceTest method testNetworkIfAzureRequestHasSubnetThenShouldReturnTrue.
@Test
public void testNetworkIfAzureRequestHasSubnetThenShouldReturnTrue() {
NetworkV4Request networkV4Request = new NetworkV4Request();
AzureNetworkV4Parameters azureNetworkV4Parameters = new AzureNetworkV4Parameters();
azureNetworkV4Parameters.setSubnetId("subnet");
networkV4Request.setAzure(azureNetworkV4Parameters);
Assert.assertFalse(underTest.shouldAddNetwork(CloudPlatform.AZURE.name(), networkV4Request));
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.network.AzureNetworkV4Parameters in project cloudbreak by hortonworks.
the class NetworkValidationServiceTest method testNetworkIfAzureRequestEmptyThenShouldReturnTrue.
@Test
public void testNetworkIfAzureRequestEmptyThenShouldReturnTrue() {
NetworkV4Request networkV4Request = new NetworkV4Request();
AzureNetworkV4Parameters azureNetworkV4Parameters = new AzureNetworkV4Parameters();
networkV4Request.setAzure(azureNetworkV4Parameters);
Assert.assertTrue(underTest.shouldAddNetwork(CloudPlatform.AZURE.name(), networkV4Request));
}
Aggregations