Search in sources :

Example 1 with StackToStackV4ResponseConverter

use of com.sequenceiq.cloudbreak.converter.v4.stacks.StackToStackV4ResponseConverter in project cloudbreak by hortonworks.

the class StackToStackV4ResponseConverterTest method setUp.

@Before
public void setUp() throws CloudbreakImageNotFoundException {
    underTest = new StackToStackV4ResponseConverter();
    MockitoAnnotations.initMocks(this);
    when(imageService.getImage(anyLong())).thenReturn(new Image("cb-centos66-amb200-2015-05-25", Collections.emptyMap(), "redhat6", "redhat6", "", "default", "default-id", new HashMap<>()));
    when(componentConfigProviderService.getCloudbreakDetails(anyLong())).thenReturn(new CloudbreakDetails("version"));
    when(componentConfigProviderService.getStackTemplate(anyLong())).thenReturn(new StackTemplate("{}", "version"));
    when(componentConfigProviderService.getTelemetry(anyLong())).thenReturn(new Telemetry());
    Mockito.doAnswer(answer -> {
        StackV4Response result = answer.getArgument(1, StackV4Response.class);
        result.setSharedService(new SharedServiceV4Response());
        return null;
    }).when(datalakeService).addSharedServiceResponse(any(Stack.class), any(StackV4Response.class));
    when(serviceEndpointCollector.filterByStackType(any(StackType.class), any(List.class))).thenReturn(new ArrayList());
    credentialResponse = new CredentialResponse();
    credentialResponse.setName("cred-name");
    credentialResponse.setCrn("crn");
    when(loadBalancerService.findByStackId(any())).thenReturn(Set.of());
}
Also used : HashMap(java.util.HashMap) CloudbreakDetails(com.sequenceiq.cloudbreak.cloud.model.CloudbreakDetails) ArrayList(java.util.ArrayList) CredentialResponse(com.sequenceiq.environment.api.v1.credential.model.response.CredentialResponse) Image(com.sequenceiq.cloudbreak.cloud.model.Image) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) SharedServiceV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.cluster.sharedservice.SharedServiceV4Response) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) StackV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response) StackType(com.sequenceiq.cloudbreak.api.endpoint.v4.common.StackType) StackToStackV4ResponseConverter(com.sequenceiq.cloudbreak.converter.v4.stacks.StackToStackV4ResponseConverter) StackTemplate(com.sequenceiq.cloudbreak.cloud.model.StackTemplate) List(java.util.List) ArrayList(java.util.ArrayList) Before(org.junit.Before)

Aggregations

StackType (com.sequenceiq.cloudbreak.api.endpoint.v4.common.StackType)1 StackV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response)1 SharedServiceV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.cluster.sharedservice.SharedServiceV4Response)1 CloudbreakDetails (com.sequenceiq.cloudbreak.cloud.model.CloudbreakDetails)1 Image (com.sequenceiq.cloudbreak.cloud.model.Image)1 StackTemplate (com.sequenceiq.cloudbreak.cloud.model.StackTemplate)1 StackToStackV4ResponseConverter (com.sequenceiq.cloudbreak.converter.v4.stacks.StackToStackV4ResponseConverter)1 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)1 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)1 CredentialResponse (com.sequenceiq.environment.api.v1.credential.model.response.CredentialResponse)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Before (org.junit.Before)1