Search in sources :

Example 16 with EnvironmentNetworkRequest

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);
}
Also used : NetworkDto(com.sequenceiq.environment.network.dto.NetworkDto) EnvironmentNetworkRequest(com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentNetworkRequest) Test(org.junit.jupiter.api.Test)

Example 17 with EnvironmentNetworkRequest

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());
}
Also used : EnvironmentRequest(com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentRequest) EnvironmentNetworkRequest(com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentNetworkRequest) Test(org.junit.jupiter.api.Test)

Example 18 with EnvironmentNetworkRequest

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;
}
Also used : TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) EnvironmentRequest(com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentRequest) EnvironmentNetworkRequest(com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentNetworkRequest)

Aggregations

EnvironmentNetworkRequest (com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentNetworkRequest)18 Test (org.junit.jupiter.api.Test)12 ConstraintViolation (javax.validation.ConstraintViolation)6 NetworkDto (com.sequenceiq.environment.network.dto.NetworkDto)5 TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)2 EnvironmentRequest (com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentRequest)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 MethodSource (org.junit.jupiter.params.provider.MethodSource)2 EnvironmentEditRequest (com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentEditRequest)1