Program: 115518
Project: 115518
Buggy source:
@Test public void testApplicationPolicy(){
  try {
    String applicationPolicyId="String_Node_Str";
    log.info("String_Node_Str");
    boolean addedN1=restClient.addEntity(RestConstants.NETWORK_PARTITIONS_PATH + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",RestConstants.NETWORK_PARTITIONS,RestConstants.NETWORK_PARTITIONS_NAME);
    assertEquals(addedN1,true);
    boolean addedN2=restClient.addEntity(RestConstants.NETWORK_PARTITIONS_PATH + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",RestConstants.NETWORK_PARTITIONS,RestConstants.NETWORK_PARTITIONS_NAME);
    assertEquals(addedN2,true);
    boolean addedDep=restClient.addEntity(RestConstants.APPLICATION_POLICIES_PATH + "String_Node_Str" + applicationPolicyId+ "String_Node_Str",RestConstants.APPLICATION_POLICIES,RestConstants.APPLICATION_POLICIES_NAME);
    assertEquals(addedDep,true);
    ApplicationPolicyBean bean=(ApplicationPolicyBean)restClient.getEntity(RestConstants.APPLICATION_POLICIES,applicationPolicyId,ApplicationPolicyBean.class,RestConstants.APPLICATION_POLICIES_NAME);
    assertEquals(bean.getId(),applicationPolicyId);
    assertEquals(String.format("String_Node_Str","String_Node_Str",applicationPolicyId),bean.getAlgorithm(),"String_Node_Str");
    assertEquals(String.format("String_Node_Str",applicationPolicyId),bean.getId(),applicationPolicyId);
    assertEquals(String.format("String_Node_Str",2,applicationPolicyId),bean.getNetworkPartitions().length,2);
    assertEquals(String.format("String_Node_Str","String_Node_Str",applicationPolicyId),bean.getNetworkPartitions()[0],"String_Node_Str");
    assertEquals(String.format("String_Node_Str","String_Node_Str",applicationPolicyId),bean.getNetworkPartitions()[1],"String_Node_Str");
    boolean algoFound=false;
    for (    PropertyBean propertyBean : bean.getProperties()) {
      if (propertyBean.getName().equals("String_Node_Str")) {
        assertEquals(String.format("String_Node_Str","String_Node_Str",applicationPolicyId),propertyBean.getValue(),"String_Node_Str");
        algoFound=true;
      }
    }
    if (!algoFound) {
      assertTrue(String.format("String_Node_Str",applicationPolicyId),false);
    }
    boolean removedNet=restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,"String_Node_Str",RestConstants.NETWORK_PARTITIONS_NAME);
    assertEquals(removedNet,false);
    boolean removedDep=restClient.removeEntity(RestConstants.APPLICATION_POLICIES,applicationPolicyId,RestConstants.APPLICATION_POLICIES_NAME);
    assertEquals(removedDep,true);
    ApplicationPolicyBean beanRemovedDep=(ApplicationPolicyBean)restClient.getEntity(RestConstants.APPLICATION_POLICIES,applicationPolicyId,ApplicationPolicyBean.class,RestConstants.APPLICATION_POLICIES_NAME);
    assertEquals(beanRemovedDep,null);
    boolean removedN1=restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,"String_Node_Str",RestConstants.NETWORK_PARTITIONS_NAME);
    assertEquals(removedN1,true);
    NetworkPartitionBean beanRemovedN1=(NetworkPartitionBean)restClient.getEntity(RestConstants.NETWORK_PARTITIONS,"String_Node_Str",NetworkPartitionBean.class,RestConstants.NETWORK_PARTITIONS_NAME);
    assertEquals(beanRemovedN1,null);
    boolean removedN2=restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,"String_Node_Str",RestConstants.NETWORK_PARTITIONS_NAME);
    assertEquals(removedN2,true);
    NetworkPartitionBean beanRemovedN2=(NetworkPartitionBean)restClient.getEntity(RestConstants.NETWORK_PARTITIONS,"String_Node_Str",NetworkPartitionBean.class,RestConstants.NETWORK_PARTITIONS_NAME);
    assertEquals(beanRemovedN2,null);
    log.info("String_Node_Str");
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    assertTrue("String_Node_Str",false);
  }
}

Fixed version (ground truth):
@Test public void testApplicationPolicy(){
  try {
    String applicationPolicyId="String_Node_Str";
    log.info("String_Node_Str");
    boolean addedN1=restClient.addEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",RestConstants.NETWORK_PARTITIONS,RestConstants.NETWORK_PARTITIONS_NAME);
    assertEquals(addedN1,true);
    boolean addedN2=restClient.addEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",RestConstants.NETWORK_PARTITIONS,RestConstants.NETWORK_PARTITIONS_NAME);
    assertEquals(addedN2,true);
    boolean addedDep=restClient.addEntity(TEST_PATH + RestConstants.APPLICATION_POLICIES_PATH + "String_Node_Str"+ applicationPolicyId+ "String_Node_Str",RestConstants.APPLICATION_POLICIES,RestConstants.APPLICATION_POLICIES_NAME);
    assertEquals(addedDep,true);
    ApplicationPolicyBean bean=(ApplicationPolicyBean)restClient.getEntity(RestConstants.APPLICATION_POLICIES,applicationPolicyId,ApplicationPolicyBean.class,RestConstants.APPLICATION_POLICIES_NAME);
    assertEquals(bean.getId(),applicationPolicyId);
    assertEquals(String.format("String_Node_Str","String_Node_Str",applicationPolicyId),bean.getAlgorithm(),"String_Node_Str");
    assertEquals(String.format("String_Node_Str",applicationPolicyId),bean.getId(),applicationPolicyId);
    assertEquals(String.format("String_Node_Str",2,applicationPolicyId),bean.getNetworkPartitions().length,2);
    assertEquals(String.format("String_Node_Str","String_Node_Str",applicationPolicyId),bean.getNetworkPartitions()[0],"String_Node_Str");
    assertEquals(String.format("String_Node_Str","String_Node_Str",applicationPolicyId),bean.getNetworkPartitions()[1],"String_Node_Str");
    boolean algoFound=false;
    for (    PropertyBean propertyBean : bean.getProperties()) {
      if (propertyBean.getName().equals("String_Node_Str")) {
        assertEquals(String.format("String_Node_Str","String_Node_Str",applicationPolicyId),propertyBean.getValue(),"String_Node_Str");
        algoFound=true;
      }
    }
    if (!algoFound) {
      assertTrue(String.format("String_Node_Str",applicationPolicyId),false);
    }
    boolean removedNet=restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,"String_Node_Str",RestConstants.NETWORK_PARTITIONS_NAME);
    assertEquals(removedNet,false);
    boolean removedDep=restClient.removeEntity(RestConstants.APPLICATION_POLICIES,applicationPolicyId,RestConstants.APPLICATION_POLICIES_NAME);
    assertEquals(removedDep,true);
    ApplicationPolicyBean beanRemovedDep=(ApplicationPolicyBean)restClient.getEntity(RestConstants.APPLICATION_POLICIES,applicationPolicyId,ApplicationPolicyBean.class,RestConstants.APPLICATION_POLICIES_NAME);
    assertEquals(beanRemovedDep,null);
    boolean removedN1=restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,"String_Node_Str",RestConstants.NETWORK_PARTITIONS_NAME);
    assertEquals(removedN1,true);
    NetworkPartitionBean beanRemovedN1=(NetworkPartitionBean)restClient.getEntity(RestConstants.NETWORK_PARTITIONS,"String_Node_Str",NetworkPartitionBean.class,RestConstants.NETWORK_PARTITIONS_NAME);
    assertEquals(beanRemovedN1,null);
    boolean removedN2=restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,"String_Node_Str",RestConstants.NETWORK_PARTITIONS_NAME);
    assertEquals(removedN2,true);
    NetworkPartitionBean beanRemovedN2=(NetworkPartitionBean)restClient.getEntity(RestConstants.NETWORK_PARTITIONS,"String_Node_Str",NetworkPartitionBean.class,RestConstants.NETWORK_PARTITIONS_NAME);
    assertEquals(beanRemovedN2,null);
    log.info("String_Node_Str");
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    assertTrue("String_Node_Str",false);
  }
}