@Test public void testCheckClusterInValidStatusWhenInStoppedStatus() { Cluster cluster = new Cluster(); cluster.setStatus(Status.STOPPED); expectedException.expect(BadRequestException.class); expectedException.expectMessage("Cluster is in Stopped status. Please start the cluster for downscale."); underTest.checkClusterInValidStatus(cluster); }
public void checkClusterInValidStatus(Cluster cluster) { if (cluster.getStatus() == Status.STOPPED) { throw new BadRequestException("Cluster is in Stopped status. Please start the cluster for downscale."); } }
StackDownscaleValidatorService { public void checkClusterInValidStatus(Cluster cluster) { if (cluster.getStatus() == Status.STOPPED) { throw new BadRequestException("Cluster is in Stopped status. Please start the cluster for downscale."); } } }
StackDownscaleValidatorService { public void checkClusterInValidStatus(Cluster cluster) { if (cluster.getStatus() == Status.STOPPED) { throw new BadRequestException("Cluster is in Stopped status. Please start the cluster for downscale."); } }  }
StackDownscaleValidatorService { public void checkClusterInValidStatus(Cluster cluster) { if (cluster.getStatus() == Status.STOPPED) { throw new BadRequestException("Cluster is in Stopped status. Please start the cluster for downscale."); } }  void checkInstanceIsTheClusterManagerServerOrNot(String instancePublicIp, InstanceMetadataType metadataType); void checkUserHasRightToTerminateInstance(String owner, String userId, Long stackId); void checkClusterInValidStatus(Cluster cluster); }
StackDownscaleValidatorService { public void checkClusterInValidStatus(Cluster cluster) { if (cluster.getStatus() == Status.STOPPED) { throw new BadRequestException("Cluster is in Stopped status. Please start the cluster for downscale."); } }  void checkInstanceIsTheClusterManagerServerOrNot(String instancePublicIp, InstanceMetadataType metadataType); void checkUserHasRightToTerminateInstance(String owner, String userId, Long stackId); void checkClusterInValidStatus(Cluster cluster);  }