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;
}
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);
}
}
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;
}
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);
}
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);
}
Aggregations