use of com.sequenceiq.environment.network.dto.NetworkDto in project cloudbreak by hortonworks.
the class NetworkDtoToResponseConverterTest method testConvertWithYarnParams.
@Test
void testConvertWithYarnParams() {
NetworkDto network = createNetworkDto().withYarn(createYarnParams()).build();
ProvidedSubnetIds providedSubnetIds = new ProvidedSubnetIds(PREFERRED_SUBNET_ID, Set.of(PREFERRED_SUBNET_ID));
when(subnetIdProvider.subnets(network, TUNNEL, network.getCloudPlatform(), true)).thenReturn(providedSubnetIds);
EnvironmentNetworkResponse actual = underTest.convert(network, TUNNEL, true);
assertCommonFields(network, actual);
assertEquals(network.getYarn().getQueue(), actual.getYarn().getQueue());
assertEquals(network.getYarn().getLifetime(), actual.getYarn().getLifetime());
assertNull(actual.getAws());
assertNull(actual.getMock());
assertNull(actual.getAzure());
}
use of com.sequenceiq.environment.network.dto.NetworkDto in project cloudbreak by hortonworks.
the class NetworkDtoToResponseConverterTest method testConvertWithLoadBalancerEnabled.
@Test
void testConvertWithLoadBalancerEnabled() {
NetworkDto network = createNetworkDto().withAws(createAwsParams()).withLoadBalancerCreation(LoadBalancerCreation.ENABLED).build();
ProvidedSubnetIds providedSubnetIds = new ProvidedSubnetIds(PREFERRED_SUBNET_ID, Set.of(PREFERRED_SUBNET_ID));
when(subnetIdProvider.subnets(network, TUNNEL, network.getCloudPlatform(), true)).thenReturn(providedSubnetIds);
EnvironmentNetworkResponse actual = underTest.convert(network, TUNNEL, true);
assertEquals(network.getAws().getVpcId(), actual.getAws().getVpcId());
assertEquals(LoadBalancerCreation.ENABLED, actual.getLoadBalancerCreation());
assertNull(actual.getAzure());
assertNull(actual.getYarn());
assertNull(actual.getMock());
}
use of com.sequenceiq.environment.network.dto.NetworkDto 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.network.dto.NetworkDto 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);
}
use of com.sequenceiq.environment.network.dto.NetworkDto in project cloudbreak by hortonworks.
the class NetworkTest method createEnvironmentDto.
protected EnvironmentDto createEnvironmentDto() {
NetworkDto networkDto = NetworkDto.builder().build();
EnvironmentDto environmentDto = new EnvironmentDto();
environmentDto.setId(123L);
environmentDto.setName("name");
environmentDto.setNetwork(networkDto);
return environmentDto;
}
Aggregations