use of com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentNetworkRequest in project cloudbreak by hortonworks.
the class NetworkCidrValidatorTest method testValidatorShouldFailWhenCidrIsNotACidr.
@Test
void testValidatorShouldFailWhenCidrIsNotACidr() {
EnvironmentNetworkRequest request = new EnvironmentNetworkRequest();
request.setNetworkCidr("16/16");
Set<ConstraintViolation<EnvironmentNetworkRequest>> violation = validator.validate(request);
MatcherAssert.assertThat(violation, hasSize(2));
MatcherAssert.assertThat(violation, hasItem(hasProperty("message", is("The format of the CIDR is not accepted. Prefix mask must be /16"))));
MatcherAssert.assertThat(violation, hasItem(hasProperty("message", is("The field should contain a valid CIDR definition."))));
}
use of com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentNetworkRequest in project cloudbreak by hortonworks.
the class EnvironmentControllerTest method setupNetworkRequestWithEndpointGatway.
private EnvironmentNetworkRequest setupNetworkRequestWithEndpointGatway() {
EnvironmentNetworkRequest networkRequest = new EnvironmentNetworkRequest();
networkRequest.setPublicEndpointAccessGateway(PublicEndpointAccessGateway.ENABLED);
networkRequest.setEndpointGatewaySubnetIds(SUBNETS);
return networkRequest;
}
use of com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentNetworkRequest in project cloudbreak by hortonworks.
the class EnvironmentApiConverterTest method createEditEnvironmentRequest.
private EnvironmentEditRequest createEditEnvironmentRequest() {
EnvironmentEditRequest request = new EnvironmentEditRequest();
request.setDescription("Test description.");
request.setNetwork(new EnvironmentNetworkRequest());
request.setAuthentication(createAuthenticationRequest());
request.setTelemetry(new TelemetryRequest());
request.setSecurityAccess(createSecurityAccessRequest());
request.setIdBrokerMappingSource(IdBrokerMappingSource.IDBMMS);
request.setCloudStorageValidation(CloudStorageValidation.DISABLED);
request.setAdminGroupName("cb-admin");
request.setAws(createAwsRequest());
return request;
}
use of com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentNetworkRequest in project cloudbreak by hortonworks.
the class NetworkRequestToDtoConverterTest method testConvertYarn.
@Test
void testConvertYarn() {
EnvironmentNetworkRequest network = createNetworkRequest();
network.setYarn(createYarnParams());
NetworkDto actual = underTest.convert(network);
assertEquals(network.getYarn().getQueue(), actual.getYarn().getQueue());
assertEquals(network.getYarn().getLifetime(), actual.getYarn().getLifetime());
assertCommonFields(network, actual);
}
use of com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentNetworkRequest in project cloudbreak by hortonworks.
the class NetworkRequestToDtoConverterTest method testConvertAws.
@Test
void testConvertAws() {
EnvironmentNetworkRequest network = createNetworkRequest();
network.setAws(createAwsParams());
NetworkDto actual = underTest.convert(network);
assertEquals(network.getAws().getVpcId(), actual.getAws().getVpcId());
assertEquals(network.getAws().getVpcId(), actual.getNetworkId());
assertCommonFields(network, actual);
}
Aggregations