Search in sources :

Example 1 with EnvironmentAuthenticationResponse

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());
}
Also used : StackAuthenticationV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.authentication.StackAuthenticationV4Request) EnvironmentAuthenticationResponse(com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentAuthenticationResponse) Test(org.junit.jupiter.api.Test)

Example 2 with EnvironmentAuthenticationResponse

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;
}
Also used : CompactRegionResponse(com.sequenceiq.environment.api.v1.environment.model.response.CompactRegionResponse) EnvironmentNetworkAwsParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams) EnvironmentAuthenticationResponse(com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentAuthenticationResponse) DetailedEnvironmentResponse(com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse) EnvironmentNetworkResponse(com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) CloudSubnet(com.sequenceiq.cloudbreak.cloud.model.CloudSubnet)

Aggregations

EnvironmentAuthenticationResponse (com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentAuthenticationResponse)2 StackAuthenticationV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.authentication.StackAuthenticationV4Request)1 CloudSubnet (com.sequenceiq.cloudbreak.cloud.model.CloudSubnet)1 EnvironmentNetworkAwsParams (com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkAwsParams)1 CompactRegionResponse (com.sequenceiq.environment.api.v1.environment.model.response.CompactRegionResponse)1 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)1 EnvironmentNetworkResponse (com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse)1 Test (org.junit.jupiter.api.Test)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1