use of com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentAuthenticationResponse in project cloudbreak by hortonworks.
the class DistroXAuthenticationToStaAuthenticationConverterTest method testConvertEnvironmentAuthenticationResponseToStackAuthenticationV4Request.
@Test
void testConvertEnvironmentAuthenticationResponseToStackAuthenticationV4Request() {
EnvironmentAuthenticationResponse input = new EnvironmentAuthenticationResponse();
input.setPublicKey("somePublicKey");
input.setPublicKeyId("somePublicKeyId");
input.setLoginUserName("someLoginUserName");
StackAuthenticationV4Request result = underTest.convert(input);
assertNotNull(result);
assertNull(result.getLoginUserName());
assertEquals(input.getPublicKey(), result.getPublicKey());
assertEquals(input.getPublicKeyId(), result.getPublicKeyId());
}
use of com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentAuthenticationResponse in project cloudbreak by hortonworks.
the class ProvisionerServiceTest method getEnvironmentResponse.
private DetailedEnvironmentResponse getEnvironmentResponse() {
DetailedEnvironmentResponse detailedEnvironmentResponse = new DetailedEnvironmentResponse();
detailedEnvironmentResponse.setName("env");
detailedEnvironmentResponse.setEnvironmentStatus(EnvironmentStatus.AVAILABLE);
CompactRegionResponse compactRegionResponse = new CompactRegionResponse();
compactRegionResponse.setNames(Lists.newArrayList("eu-west-1"));
compactRegionResponse.setDisplayNames(Map.of("eu-west-1", "ireland"));
detailedEnvironmentResponse.setRegions(compactRegionResponse);
detailedEnvironmentResponse.setCrn(CrnTestUtil.getEnvironmentCrnBuilder().setResource(UUID.randomUUID().toString()).setAccountId(UUID.randomUUID().toString()).build().toString());
EnvironmentNetworkResponse network = new EnvironmentNetworkResponse();
network.setCrn(CrnTestUtil.getNetworkCrnBuilder().setResource(UUID.randomUUID().toString()).setAccountId(UUID.randomUUID().toString()).build().toString());
EnvironmentNetworkAwsParams environmentNetworkAwsParams = new EnvironmentNetworkAwsParams();
environmentNetworkAwsParams.setVpcId("vpc");
network.setAws(environmentNetworkAwsParams);
network.setSubnetIds(Sets.newHashSet("subnet"));
CloudSubnet cloudSubnet = new CloudSubnet();
cloudSubnet.setId("subnet");
cloudSubnet.setName("subnet");
cloudSubnet.setAvailabilityZone("eu-west-1a");
Map<String, CloudSubnet> cloudSubnetMap = Map.of("subnet", cloudSubnet);
network.setSubnetMetas(cloudSubnetMap);
detailedEnvironmentResponse.setNetwork(network);
EnvironmentAuthenticationResponse authentication = new EnvironmentAuthenticationResponse();
authentication.setPublicKey("ssh-public-key");
detailedEnvironmentResponse.setAuthentication(authentication);
return detailedEnvironmentResponse;
}
Aggregations