use of com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentNetworkRequest in project cloudbreak by hortonworks.
the class NetworkRequestToDtoConverterTest method testConvertMock.
@Test
void testConvertMock() {
EnvironmentNetworkRequest network = createNetworkRequest();
network.setMock(createMockParams());
NetworkDto actual = underTest.convert(network);
assertEquals(network.getMock().getVpcId(), actual.getMock().getVpcId());
assertEquals(network.getMock().getInternetGatewayId(), actual.getMock().getInternetGatewayId());
assertCommonFields(network, actual);
}
use of com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentNetworkRequest in project cloudbreak by hortonworks.
the class EnvironmentControllerTest method testEndpointGatewayOptionsPreserved.
@Test
void testEndpointGatewayOptionsPreserved() {
EnvironmentNetworkRequest networkRequest = setupNetworkRequestWithEndpointGatway();
EnvironmentRequest environmentRequest = new EnvironmentRequest();
environmentRequest.setNetwork(networkRequest);
setupServiceResponses();
ThreadBasedUserCrnProvider.doAs(USER_CRN, () -> underTest.post(environmentRequest));
assertEquals(PublicEndpointAccessGateway.ENABLED, networkRequest.getPublicEndpointAccessGateway());
assertEquals(SUBNETS, networkRequest.getEndpointGatewaySubnetIds());
}
use of com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentNetworkRequest in project cloudbreak by hortonworks.
the class EnvironmentApiConverterTest method createEnvironmentRequest.
private EnvironmentRequest createEnvironmentRequest(CloudPlatform cloudPlatform) {
EnvironmentRequest request = new EnvironmentRequest();
request.setName("test-cluster");
request.setDescription("Test description.");
request.setCredentialName(CREDENTIAL_NAME);
request.setLocation(createLocationRequest());
request.setNetwork(new EnvironmentNetworkRequest());
request.setTelemetry(new TelemetryRequest());
request.setAuthentication(createAuthenticationRequest());
request.setFreeIpa(createFreeIpaRequest());
request.setSecurityAccess(createSecurityAccessRequest());
request.setTunnel(Tunnel.CCM);
request.setIdBrokerMappingSource(IdBrokerMappingSource.IDBMMS);
request.setCloudStorageValidation(CloudStorageValidation.DISABLED);
request.setAdminGroupName("cb-admin");
request.setProxyConfigName("my-proxy");
request.setTags(Map.of("owner", "cloudbreak"));
request.setParentEnvironmentName("parent-env");
request.setCcmV2TlsType(CcmV2TlsType.ONE_WAY_TLS);
setParameters(request, cloudPlatform);
return request;
}
Aggregations