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));
}
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));
}
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());
}
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());
}
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)));
}
Aggregations