use of com.sequenceiq.cloudbreak.api.model.ClusterResponse in project cloudbreak by hortonworks.
the class StackToStackResponseConverterTest method testConvertWithoutFailurePolicy.
@Test
public void testConvertWithoutFailurePolicy() {
// GIVEN
getSource().setFailurePolicy(null);
given(conversionService.convert(any(Object.class), any(Class.class))).willReturn(new ImageJson()).willReturn(new StackAuthenticationResponse()).willReturn(new CredentialResponse()).willReturn(new ClusterResponse()).willReturn(new NetworkResponse()).willReturn(new OrchestratorResponse()).willReturn(new CloudbreakDetailsJson()).willReturn(new CredentialResponse()).willReturn(new NetworkResponse());
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("failurePolicy", "platformVariant", "ambariVersion", "hdpVersion", "stackTemplate", "cloudbreakDetails", "flexSubscription"));
}
use of com.sequenceiq.cloudbreak.api.model.ClusterResponse 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"));
}
use of com.sequenceiq.cloudbreak.api.model.ClusterResponse in project cloudbreak by hortonworks.
the class ClusterToClusterResponseConverterTest method testConvertWithoutMasterComponent.
@Test
public void testConvertWithoutMasterComponent() throws IOException {
// GIVEN
mockAll();
given(stackServiceComponentDescs.get(anyString())).willReturn(new StackServiceComponentDescriptor("dummy", "dummy", 1, 1));
// WHEN
ClusterResponse result = underTest.convert(getSource());
// THEN
assertEquals(1L, (long) result.getId());
}
Aggregations