Search in sources :

Example 1 with ServiceEndpointCreation

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

the class OutboundInternetTrafficValidator method isValid.

@Override
public boolean isValid(EnvironmentNetworkRequest environmentNetworkRequest, ConstraintValidatorContext constraintValidatorContext) {
    OutboundInternetTraffic outboundInternetTraffic = environmentNetworkRequest.getOutboundInternetTraffic();
    ServiceEndpointCreation serviceEndpointCreation = environmentNetworkRequest.getServiceEndpointCreation();
    if (outboundInternetTraffic == OutboundInternetTraffic.DISABLED && (serviceEndpointCreation == null || serviceEndpointCreation == ServiceEndpointCreation.DISABLED)) {
        return false;
    }
    return true;
}
Also used : ServiceEndpointCreation(com.sequenceiq.common.api.type.ServiceEndpointCreation) OutboundInternetTraffic(com.sequenceiq.common.api.type.OutboundInternetTraffic)

Example 2 with ServiceEndpointCreation

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

the class AwsCloudProviderAssertion 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 (serviceEndpointCreationResponse != serviceEndpointCreationRequest) {
        String message = String.format("Service endpoint creation is expected to be %s, but is %s", serviceEndpointCreationRequest, serviceEndpointCreationResponse);
        LOGGER.error(message);
        throw new TestFailException(message);
    }
}
Also used : ServiceEndpointCreation(com.sequenceiq.common.api.type.ServiceEndpointCreation) TestFailException(com.sequenceiq.it.cloudbreak.exception.TestFailException)

Example 3 with ServiceEndpointCreation

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

the class AzureCloudProvider method serviceEndpoint.

@Override
public ServiceEndpointCreation serviceEndpoint() {
    ServiceEndpointCreation serviceEndpointCreation = ResourceGroupTest.isSingleResourceGroup(getTestParameter().get(ResourceGroupTest.AZURE_RESOURCE_GROUP_USAGE)) ? ServiceEndpointCreation.ENABLED_PRIVATE_ENDPOINT : ServiceEndpointCreation.DISABLED;
    LOGGER.debug("Azure service endpoint creation: {}", serviceEndpointCreation);
    return serviceEndpointCreation;
}
Also used : ServiceEndpointCreation(com.sequenceiq.common.api.type.ServiceEndpointCreation)

Example 4 with ServiceEndpointCreation

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

the class ServiceEndpointCreationConverterTest method testConvertToEntityAttributeWhenEnabledIsReturnAsEnabled.

@Test
public void testConvertToEntityAttributeWhenEnabledIsReturnAsEnabled() {
    ServiceEndpointCreation serviceEndpointCreation = serviceEndpointCreationConverter.convertToEntityAttribute("ENABLED");
    Assert.assertEquals(ServiceEndpointCreation.ENABLED, serviceEndpointCreation);
}
Also used : ServiceEndpointCreation(com.sequenceiq.common.api.type.ServiceEndpointCreation) Test(org.junit.jupiter.api.Test)

Example 5 with ServiceEndpointCreation

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

the class ServiceEndpointCreationConverterTest method testConvertToEntityAttributeWhenNotKnownIsReturnAsDisabled.

@Test
public void testConvertToEntityAttributeWhenNotKnownIsReturnAsDisabled() {
    ServiceEndpointCreation serviceEndpointCreation = serviceEndpointCreationConverter.convertToEntityAttribute("not-known");
    Assert.assertEquals(ServiceEndpointCreation.DISABLED, serviceEndpointCreation);
}
Also used : ServiceEndpointCreation(com.sequenceiq.common.api.type.ServiceEndpointCreation) Test(org.junit.jupiter.api.Test)

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