Search in sources :

Example 31 with StackResponse

use of com.sequenceiq.cloudbreak.api.model.StackResponse in project cloudbreak by hortonworks.

the class StackToStackResponseConverterTest method testConvertWithoutCluster.

@Test
public void testConvertWithoutCluster() {
    // GIVEN
    getSource().setCluster(null);
    given(conversionService.convert(any(Object.class), any(Class.class))).willReturn(new ImageJson()).willReturn(new StackAuthenticationResponse()).willReturn(new CredentialResponse()).willReturn(new FailurePolicyResponse()).willReturn(new NetworkResponse()).willReturn(new OrchestratorResponse()).willReturn(new CloudbreakDetailsJson());
    given(conversionService.convert(any(Object.class), any(TypeDescriptor.class), any(TypeDescriptor.class))).willReturn(new HashSet<InstanceGroupRequest>());
    getSource().setCluster(null);
    // WHEN
    StackResponse result = underTest.convert(getSource());
    // THEN
    assertAllFieldsNotNull(result, Arrays.asList("cluster", "platformVariant", "ambariVersion", "hdpVersion", "flexSubscription"));
}
Also used : InstanceGroupRequest(com.sequenceiq.cloudbreak.api.model.InstanceGroupRequest) CloudbreakDetailsJson(com.sequenceiq.cloudbreak.api.model.CloudbreakDetailsJson) CredentialResponse(com.sequenceiq.cloudbreak.api.model.CredentialResponse) OrchestratorResponse(com.sequenceiq.cloudbreak.api.model.OrchestratorResponse) FailurePolicyResponse(com.sequenceiq.cloudbreak.api.model.FailurePolicyResponse) TypeDescriptor(org.springframework.core.convert.TypeDescriptor) ImageJson(com.sequenceiq.cloudbreak.api.model.ImageJson) NetworkResponse(com.sequenceiq.cloudbreak.api.model.NetworkResponse) StackAuthenticationResponse(com.sequenceiq.cloudbreak.api.model.StackAuthenticationResponse) StackResponse(com.sequenceiq.cloudbreak.api.model.StackResponse) Test(org.junit.Test)

Example 32 with StackResponse

use of com.sequenceiq.cloudbreak.api.model.StackResponse in project cloudbreak by hortonworks.

the class StackToStackResponseConverterTest method testConvert.

@Test
public void testConvert() {
    // GIVEN
    given(conversionService.convert(any(Object.class), any(Class.class))).willReturn(new ImageJson()).willReturn(new StackAuthenticationResponse()).willReturn(new CredentialResponse()).willReturn(new ClusterResponse()).willReturn(new FailurePolicyResponse()).willReturn(new NetworkResponse()).willReturn(new OrchestratorResponse()).willReturn(new CloudbreakDetailsJson());
    given(conversionService.convert(any(Object.class), any(TypeDescriptor.class), any(TypeDescriptor.class))).willReturn(new HashSet<InstanceGroupRequest>());
    // WHEN
    StackResponse result = underTest.convert(getSource());
    // THEN
    assertAllFieldsNotNull(result, Arrays.asList("platformVariant", "ambariVersion", "hdpVersion", "flexSubscription"));
}
Also used : InstanceGroupRequest(com.sequenceiq.cloudbreak.api.model.InstanceGroupRequest) CloudbreakDetailsJson(com.sequenceiq.cloudbreak.api.model.CloudbreakDetailsJson) ClusterResponse(com.sequenceiq.cloudbreak.api.model.ClusterResponse) CredentialResponse(com.sequenceiq.cloudbreak.api.model.CredentialResponse) OrchestratorResponse(com.sequenceiq.cloudbreak.api.model.OrchestratorResponse) FailurePolicyResponse(com.sequenceiq.cloudbreak.api.model.FailurePolicyResponse) TypeDescriptor(org.springframework.core.convert.TypeDescriptor) ImageJson(com.sequenceiq.cloudbreak.api.model.ImageJson) NetworkResponse(com.sequenceiq.cloudbreak.api.model.NetworkResponse) StackAuthenticationResponse(com.sequenceiq.cloudbreak.api.model.StackAuthenticationResponse) StackResponse(com.sequenceiq.cloudbreak.api.model.StackResponse) Test(org.junit.Test)

Aggregations

StackResponse (com.sequenceiq.cloudbreak.api.model.StackResponse)32 Test (org.testng.annotations.Test)10 IntegrationTestContext (com.sequenceiq.it.IntegrationTestContext)9 Parameters (org.testng.annotations.Parameters)9 AbstractCloudbreakIntegrationTest (com.sequenceiq.it.cloudbreak.AbstractCloudbreakIntegrationTest)8 StackV1Endpoint (com.sequenceiq.cloudbreak.api.endpoint.v1.StackV1Endpoint)7 Map (java.util.Map)7 CredentialResponse (com.sequenceiq.cloudbreak.api.model.CredentialResponse)6 ImageJson (com.sequenceiq.cloudbreak.api.model.ImageJson)6 OrchestratorResponse (com.sequenceiq.cloudbreak.api.model.OrchestratorResponse)6 StackAuthenticationResponse (com.sequenceiq.cloudbreak.api.model.StackAuthenticationResponse)6 HashMap (java.util.HashMap)6 CloudbreakDetailsJson (com.sequenceiq.cloudbreak.api.model.CloudbreakDetailsJson)5 ClusterResponse (com.sequenceiq.cloudbreak.api.model.ClusterResponse)5 FailurePolicyResponse (com.sequenceiq.cloudbreak.api.model.FailurePolicyResponse)5 InstanceGroupRequest (com.sequenceiq.cloudbreak.api.model.InstanceGroupRequest)5 InstanceMetaDataJson (com.sequenceiq.cloudbreak.api.model.InstanceMetaDataJson)5 NetworkResponse (com.sequenceiq.cloudbreak.api.model.NetworkResponse)5 CloudbreakClient (com.sequenceiq.cloudbreak.client.CloudbreakClient)5 Test (org.junit.Test)5