Search in sources :

Example 1 with StackViewV4Responses

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackViewV4Responses in project cloudbreak by hortonworks.

the class EnvironmentResourceDeletionServiceTest method getDatalakeClusterNames.

@Test
void getDatalakeClusterNames() {
    when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn:cdp:datahub:us-west-1:altus:user:__internal__actor__");
    when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
    when(datalakeEndpoint.list(isNull(), anyString())).thenReturn(new StackViewV4Responses());
    environmentResourceDeletionServiceUnderTest.getDatalakeClusterNames(environment);
    verify(datalakeEndpoint).list(isNull(), eq(ENVIRONMENT_CRN));
}
Also used : StackViewV4Responses(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackViewV4Responses) Test(org.junit.jupiter.api.Test)

Example 2 with StackViewV4Responses

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackViewV4Responses in project cloudbreak by hortonworks.

the class EnvironmentResourceDeletionServiceTest method getAttachedDistroXClusterNames.

@Test
void getAttachedDistroXClusterNames() {
    when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn:cdp:datahub:us-west-1:altus:user:__internal__actor__");
    when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
    when(distroXEndpoint.list(any(), anyString())).thenReturn(new StackViewV4Responses());
    environmentResourceDeletionServiceUnderTest.getAttachedDistroXClusterNames(environment);
    verify(distroXEndpoint).list(isNull(), eq(ENVIRONMENT_CRN));
}
Also used : StackViewV4Responses(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackViewV4Responses) Test(org.junit.jupiter.api.Test)

Example 3 with StackViewV4Responses

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackViewV4Responses in project cloudbreak by hortonworks.

the class LoadBalancerPollerServiceTest method testPollingForSingleDatalake.

@Test
public void testPollingForSingleDatalake() {
    setupDatalakeResponse();
    when(regionAwareInternalCrnGenerator.getInternalCrnForServiceAsString()).thenReturn("crn");
    when(regionAwareInternalCrnGeneratorFactory.iam()).thenReturn(regionAwareInternalCrnGenerator);
    when(datahubService.list(ENV_CRN)).thenReturn(new StackViewV4Responses());
    when(stackService.updateLoadBalancer(anySet())).thenReturn(setupFlowIdentifiers(1));
    when(flowEndpoint.hasFlowRunningByFlowId(anyString())).thenReturn(setupFinishedFlowCheckResponse());
    when(flowEndpoint.getFlowLogsByFlowId(anyString())).thenReturn(List.of(setupSuccessFlowLogResponse()));
    underTest.updateStackWithLoadBalancer(ENV_ID, ENV_CRN, ENV_NAME, PublicEndpointAccessGateway.ENABLED);
    verify(stackService, times(1)).updateLoadBalancer(eq(Set.of(DL_NAME)));
    verify(flowEndpoint, times(1)).hasFlowRunningByFlowId(anyString());
    verify(flowEndpoint, times(1)).getFlowLogsByFlowId(anyString());
}
Also used : StackViewV4Responses(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackViewV4Responses) Test(org.junit.jupiter.api.Test)

Example 4 with StackViewV4Responses

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackViewV4Responses in project cloudbreak by hortonworks.

the class LoadBalancerPollerServiceTest method testPollingNoStacks.

@Test
public void testPollingNoStacks() {
    when(sdxService.list(ENV_NAME)).thenReturn(List.of());
    when(datahubService.list(ENV_CRN)).thenReturn(new StackViewV4Responses());
    underTest.updateStackWithLoadBalancer(ENV_ID, ENV_CRN, ENV_NAME, PublicEndpointAccessGateway.DISABLED);
    verify(stackService, never()).updateLoadBalancer(anySet());
}
Also used : StackViewV4Responses(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackViewV4Responses) Test(org.junit.jupiter.api.Test)

Example 5 with StackViewV4Responses

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackViewV4Responses in project cloudbreak by hortonworks.

the class LoadBalancerPollerServiceTest method setupDatahubResponse.

private void setupDatahubResponse() {
    StackViewV4Response response1 = new StackViewV4Response();
    response1.setName(DH_NAME1);
    StackViewV4Response response2 = new StackViewV4Response();
    response2.setName(DH_NAME2);
    when(datahubService.list(ENV_CRN)).thenReturn(new StackViewV4Responses(Set.of(response1, response2)));
}
Also used : StackViewV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackViewV4Response) StackViewV4Responses(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackViewV4Responses)

Aggregations

StackViewV4Responses (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackViewV4Responses)33 Test (org.junit.jupiter.api.Test)19 StackViewV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackViewV4Response)18 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)14 Test (org.junit.Test)8 PollingConfig (com.sequenceiq.environment.util.PollingConfig)4 NameOrCrn (com.sequenceiq.cloudbreak.api.endpoint.v4.dto.NameOrCrn)3 UpgradeV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.tags.upgrade.UpgradeV4Request)3 UpgradeOptionV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.upgrade.UpgradeOptionV4Response)3 UpgradeV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.upgrade.UpgradeV4Response)3 Image (com.sequenceiq.cloudbreak.cloud.model.Image)3 StackInstanceCount (com.sequenceiq.cloudbreak.domain.projection.StackInstanceCount)3 InstanceMetaData (com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData)3 RepairValidation (com.sequenceiq.cloudbreak.service.cluster.model.RepairValidation)3 StatedImage (com.sequenceiq.cloudbreak.service.image.StatedImage)3 Environment (com.sequenceiq.environment.environment.domain.Environment)3 HashMap (java.util.HashMap)3 Map (java.util.Map)3 ClusterViewV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.views.ClusterViewV4Response)2 DistroXMultiDeleteV1Request (com.sequenceiq.distrox.api.v1.distrox.model.cluster.DistroXMultiDeleteV1Request)2