use of com.sequenceiq.cloudbreak.client.CloudbreakServiceCrnEndpoints in project cloudbreak by hortonworks.
the class ScalingRequestTest method initScaleUpMocks.
private void initScaleUpMocks() {
when(scalingHardLimitsService.isViolatingAutoscaleMaxStepInNodeCount(anyInt())).thenReturn(false);
ClusterPertain cluterPertain = mock(ClusterPertain.class);
when(cluster.getClusterPertain()).thenReturn(cluterPertain);
when(cluster.getStackCrn()).thenReturn("testStackCrn");
when(cluterPertain.getTenant()).thenReturn("testTenant");
lenient().when(cluterPertain.getUserId()).thenReturn("userId");
BaseAlert baseAlert = mock(BaseAlert.class);
when(baseAlert.getAlertType()).thenReturn(AlertType.LOAD);
when(scalingPolicy.getAlert()).thenReturn(baseAlert);
when(scalingPolicy.getHostGroup()).thenReturn("compute");
doNothing().when(metricService).incrementMetricCounter(MetricType.CLUSTER_UPSCALE_TRIGGERED);
CloudbreakServiceCrnEndpoints cloudbreakServiceCrnEndpoints = mock(CloudbreakServiceCrnEndpoints.class);
when(cloudbreakServiceCrnEndpoints.autoscaleEndpoint()).thenReturn(autoscaleV4Endpoint);
when(cloudbreakCrnClient.withInternalCrn()).thenReturn(cloudbreakServiceCrnEndpoints);
when(cloudbreakMessagesService.getMessage(anyString(), any(List.class))).thenReturn("test");
}
Aggregations