Search in sources :

Example 1 with CloudbreakServiceCrnEndpoints

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");
}
Also used : ClusterPertain(com.sequenceiq.periscope.domain.ClusterPertain) CloudbreakServiceCrnEndpoints(com.sequenceiq.cloudbreak.client.CloudbreakServiceCrnEndpoints) BaseAlert(com.sequenceiq.periscope.domain.BaseAlert) List(java.util.List)

Aggregations

CloudbreakServiceCrnEndpoints (com.sequenceiq.cloudbreak.client.CloudbreakServiceCrnEndpoints)1 BaseAlert (com.sequenceiq.periscope.domain.BaseAlert)1 ClusterPertain (com.sequenceiq.periscope.domain.ClusterPertain)1 List (java.util.List)1