Program: 63920
Project: 63920
Buggy source:
@Test @Parameters({"String_Node_Str","String_Node_Str"}) public void testScaling(@Optional("String_Node_Str") String instanceGroup,@Optional("String_Node_Str") int scalingAdjustment) throws Exception {
  IntegrationTestContext itContext=getItContext();
  String stackId=itContext.getContextParam(CloudbreakITContextConstants.STACK_ID);
  int stackIntId=Integer.valueOf(stackId);
  if (scalingAdjustment < 0) {
    UpdateClusterJson updateClusterJson=new UpdateClusterJson();
    HostGroupAdjustmentJson hostGroupAdjustmentJson=new HostGroupAdjustmentJson();
    hostGroupAdjustmentJson.setHostGroup(instanceGroup);
    hostGroupAdjustmentJson.setWithStackUpdate(false);
    hostGroupAdjustmentJson.setScalingAdjustment(scalingAdjustment);
    updateClusterJson.setHostGroupAdjustment(hostGroupAdjustmentJson);
    getCloudbreakClient().clusterEndpoint().put(Long.valueOf(stackIntId),updateClusterJson);
    CloudbreakUtil.waitAndCheckClusterStatus(getCloudbreakClient(),stackId,"String_Node_Str");
    UpdateStackJson updateStackJson=new UpdateStackJson();
    InstanceGroupAdjustmentJson instanceGroupAdjustmentJson=new InstanceGroupAdjustmentJson();
    instanceGroupAdjustmentJson.setInstanceGroup(instanceGroup);
    instanceGroupAdjustmentJson.setScalingAdjustment(scalingAdjustment);
    instanceGroupAdjustmentJson.setWithClusterEvent(false);
    updateStackJson.setInstanceGroupAdjustment(instanceGroupAdjustmentJson);
    getCloudbreakClient().stackEndpoint().put(Long.valueOf(stackIntId),updateStackJson);
    CloudbreakUtil.waitAndCheckStackStatus(getCloudbreakClient(),stackId,"String_Node_Str");
  }
 else {
    UpdateStackJson updateStackJson=new UpdateStackJson();
    InstanceGroupAdjustmentJson instanceGroupAdjustmentJson=new InstanceGroupAdjustmentJson();
    instanceGroupAdjustmentJson.setInstanceGroup(instanceGroup);
    instanceGroupAdjustmentJson.setScalingAdjustment(scalingAdjustment);
    instanceGroupAdjustmentJson.setWithClusterEvent(false);
    updateStackJson.setInstanceGroupAdjustment(instanceGroupAdjustmentJson);
    getCloudbreakClient().stackEndpoint().put(Long.valueOf(stackIntId),updateStackJson);
    CloudbreakUtil.waitAndCheckStackStatus(getCloudbreakClient(),stackId,"String_Node_Str");
    UpdateClusterJson updateClusterJson=new UpdateClusterJson();
    HostGroupAdjustmentJson hostGroupAdjustmentJson=new HostGroupAdjustmentJson();
    hostGroupAdjustmentJson.setHostGroup(instanceGroup);
    hostGroupAdjustmentJson.setWithStackUpdate(false);
    hostGroupAdjustmentJson.setScalingAdjustment(scalingAdjustment);
    updateClusterJson.setHostGroupAdjustment(hostGroupAdjustmentJson);
    getCloudbreakClient().clusterEndpoint().put(Long.valueOf(stackIntId),updateClusterJson);
    CloudbreakUtil.waitAndCheckClusterStatus(getCloudbreakClient(),stackId,"String_Node_Str");
  }
  CloudbreakUtil.checkClusterAvailability(itContext.getContextParam(CloudbreakITContextConstants.CLOUDBREAK_CLIENT,CloudbreakClient.class).stackEndpoint(),stackId,itContext.getContextParam(CloudbreakITContextConstants.AMBARI_USER_ID),itContext.getContextParam(CloudbreakITContextConstants.AMBARI_PASSWORD_ID));
}

Fixed version (ground truth):
@Test @Parameters({"String_Node_Str","String_Node_Str"}) public void testScaling(@Optional("String_Node_Str") String instanceGroup,@Optional("String_Node_Str") int scalingAdjustment) throws Exception {
  IntegrationTestContext itContext=getItContext();
  String stackId=itContext.getContextParam(CloudbreakITContextConstants.STACK_ID);
  int stackIntId=Integer.valueOf(stackId);
  if (scalingAdjustment < 0) {
    UpdateClusterJson updateClusterJson=new UpdateClusterJson();
    HostGroupAdjustmentJson hostGroupAdjustmentJson=new HostGroupAdjustmentJson();
    hostGroupAdjustmentJson.setHostGroup(instanceGroup);
    hostGroupAdjustmentJson.setWithStackUpdate(false);
    hostGroupAdjustmentJson.setScalingAdjustment(scalingAdjustment);
    updateClusterJson.setHostGroupAdjustment(hostGroupAdjustmentJson);
    CloudbreakUtil.checkResponse("String_Node_Str",getCloudbreakClient().clusterEndpoint().put(Long.valueOf(stackIntId),updateClusterJson));
    CloudbreakUtil.waitAndCheckClusterStatus(getCloudbreakClient(),stackId,"String_Node_Str");
    UpdateStackJson updateStackJson=new UpdateStackJson();
    InstanceGroupAdjustmentJson instanceGroupAdjustmentJson=new InstanceGroupAdjustmentJson();
    instanceGroupAdjustmentJson.setInstanceGroup(instanceGroup);
    instanceGroupAdjustmentJson.setScalingAdjustment(scalingAdjustment);
    instanceGroupAdjustmentJson.setWithClusterEvent(false);
    updateStackJson.setInstanceGroupAdjustment(instanceGroupAdjustmentJson);
    CloudbreakUtil.checkResponse("String_Node_Str",getCloudbreakClient().stackEndpoint().put(Long.valueOf(stackIntId),updateStackJson));
    CloudbreakUtil.waitAndCheckStackStatus(getCloudbreakClient(),stackId,"String_Node_Str");
  }
 else {
    UpdateStackJson updateStackJson=new UpdateStackJson();
    InstanceGroupAdjustmentJson instanceGroupAdjustmentJson=new InstanceGroupAdjustmentJson();
    instanceGroupAdjustmentJson.setInstanceGroup(instanceGroup);
    instanceGroupAdjustmentJson.setScalingAdjustment(scalingAdjustment);
    instanceGroupAdjustmentJson.setWithClusterEvent(false);
    updateStackJson.setInstanceGroupAdjustment(instanceGroupAdjustmentJson);
    CloudbreakUtil.checkResponse("String_Node_Str",getCloudbreakClient().stackEndpoint().put(Long.valueOf(stackIntId),updateStackJson));
    CloudbreakUtil.waitAndCheckStackStatus(getCloudbreakClient(),stackId,"String_Node_Str");
    UpdateClusterJson updateClusterJson=new UpdateClusterJson();
    HostGroupAdjustmentJson hostGroupAdjustmentJson=new HostGroupAdjustmentJson();
    hostGroupAdjustmentJson.setHostGroup(instanceGroup);
    hostGroupAdjustmentJson.setWithStackUpdate(false);
    hostGroupAdjustmentJson.setScalingAdjustment(scalingAdjustment);
    updateClusterJson.setHostGroupAdjustment(hostGroupAdjustmentJson);
    CloudbreakUtil.checkResponse("String_Node_Str",getCloudbreakClient().clusterEndpoint().put(Long.valueOf(stackIntId),updateClusterJson));
    CloudbreakUtil.waitAndCheckClusterStatus(getCloudbreakClient(),stackId,"String_Node_Str");
  }
  CloudbreakUtil.checkClusterAvailability(itContext.getContextParam(CloudbreakITContextConstants.CLOUDBREAK_CLIENT,CloudbreakClient.class).stackEndpoint(),stackId,itContext.getContextParam(CloudbreakITContextConstants.AMBARI_USER_ID),itContext.getContextParam(CloudbreakITContextConstants.AMBARI_PASSWORD_ID));
}