Search in sources :

Example 6 with ServiceEndpointCreation

use of com.sequenceiq.common.api.type.ServiceEndpointCreation in project cloudbreak by hortonworks.

the class AzureCloudProviderAssertion method assertServiceEndpoint.

@Override
public void assertServiceEndpoint(EnvironmentTestDto environmentTestDto) {
    ServiceEndpointCreation serviceEndpointCreationRequest = Optional.ofNullable(environmentTestDto.getRequest().getNetwork().getServiceEndpointCreation()).orElse(ServiceEndpointCreation.DISABLED);
    ServiceEndpointCreation serviceEndpointCreationResponse = environmentTestDto.getResponse().getNetwork().getServiceEndpointCreation();
    if (serviceEndpointCreationRequest != serviceEndpointCreationResponse) {
        String message = String.format("Service endpoint creation in request (%s) does not match that in response (%s)", serviceEndpointCreationRequest, serviceEndpointCreationResponse);
        LOGGER.error(message);
        throw new TestFailException(message);
    }
    String databasePrivateDnsZoneIdRequest = environmentTestDto.getRequest().getNetwork().getAzure().getDatabasePrivateDnsZoneId();
    String databasePrivateDnsZoneIdResponse = environmentTestDto.getResponse().getNetwork().getAzure().getDatabasePrivateDnsZoneId();
    if (StringUtils.isNotEmpty(databasePrivateDnsZoneIdRequest) && !databasePrivateDnsZoneIdRequest.equals(databasePrivateDnsZoneIdResponse)) {
        String message = String.format("Private DNS zone id for database was requested to be %s, but is %s", databasePrivateDnsZoneIdRequest, databasePrivateDnsZoneIdResponse);
        LOGGER.error(message);
        throw new TestFailException(message);
    }
}
Also used : ServiceEndpointCreation(com.sequenceiq.common.api.type.ServiceEndpointCreation) TestFailException(com.sequenceiq.it.cloudbreak.exception.TestFailException)

Aggregations

ServiceEndpointCreation (com.sequenceiq.common.api.type.ServiceEndpointCreation)6 TestFailException (com.sequenceiq.it.cloudbreak.exception.TestFailException)2 Test (org.junit.jupiter.api.Test)2 OutboundInternetTraffic (com.sequenceiq.common.api.type.OutboundInternetTraffic)1