Program: 55510
Project: 55510
Buggy source:
@Test public void testResolveUserTagProperties() throws Exception {
  AmazonEC2 amazonEC2=Mockito.mock(AmazonEC2.class);
  InstanceIdProvider instanceIdProvider=Mockito.mock(InstanceIdProvider.class);
  AmazonEC2PropertyPlaceHolder amazonEC2PropertyPlaceHolder=getAmazonEC2PropertyPlaceHolder("String_Node_Str","String_Node_Str",amazonEC2,instanceIdProvider);
  amazonEC2PropertyPlaceHolder.setResolveUserDataForInstance(false);
  Mockito.when(instanceIdProvider.getCurrentInstanceId()).thenReturn("String_Node_Str");
  DescribeInstancesRequest describeInstancesRequest=new DescribeInstancesRequest().withInstanceIds("String_Node_Str");
  Instance targetInstance=new Instance().withTags(new Tag("String_Node_Str","String_Node_Str"),new Tag("String_Node_Str","String_Node_Str")).withInstanceId("String_Node_Str");
  Instance anotherInstanceInSameReservation=new Instance().withTags(new Tag("String_Node_Str","String_Node_Str")).withInstanceId("String_Node_Str");
  Reservation reservation=new Reservation().withInstances(targetInstance,anotherInstanceInSameReservation);
  DescribeInstancesResult describeInstancesResult=new DescribeInstancesResult().withReservations(reservation);
  Mockito.when(amazonEC2.describeInstances(Matchers.refEq(describeInstancesRequest))).thenReturn(describeInstancesResult);
  amazonEC2PropertyPlaceHolder.afterPropertiesSet();
  Assert.assertEquals("String_Node_Str",amazonEC2PropertyPlaceHolder.resolvePlaceholder("String_Node_Str",null));
  Assert.assertEquals("String_Node_Str",amazonEC2PropertyPlaceHolder.resolvePlaceholder("String_Node_Str",null));
  Assert.assertNull(amazonEC2PropertyPlaceHolder.resolvePlaceholder("String_Node_Str",new Properties()));
}

Fixed version (ground truth):
@Test public void testResolveUserTagProperties() throws Exception {
  AmazonEC2 amazonEC2=Mockito.mock(AmazonEC2.class);
  InstanceIdProvider instanceIdProvider=Mockito.mock(InstanceIdProvider.class);
  AmazonEC2PropertyPlaceHolder amazonEC2PropertyPlaceHolder=getAmazonEC2PropertyPlaceHolder("String_Node_Str","String_Node_Str",amazonEC2,instanceIdProvider);
  amazonEC2PropertyPlaceHolder.setResolveUserDataForInstance(false);
  Mockito.when(instanceIdProvider.getCurrentInstanceId()).thenReturn("String_Node_Str");
  DescribeInstancesRequest describeInstancesRequest=new DescribeInstancesRequest().withInstanceIds("String_Node_Str");
  Instance targetInstance=new Instance().withTags(new Tag("String_Node_Str","String_Node_Str"),new Tag("String_Node_Str","String_Node_Str")).withInstanceId("String_Node_Str");
  Instance anotherInstanceInSameReservation=new Instance().withTags(new Tag("String_Node_Str","String_Node_Str")).withInstanceId("String_Node_Str");
  Reservation reservation=new Reservation().withInstances(targetInstance,anotherInstanceInSameReservation);
  DescribeInstancesResult describeInstancesResult=new DescribeInstancesResult().withReservations(reservation);
  Mockito.when(amazonEC2.describeInstances(describeInstancesRequest)).thenReturn(describeInstancesResult);
  amazonEC2PropertyPlaceHolder.afterPropertiesSet();
  Assert.assertEquals("String_Node_Str",amazonEC2PropertyPlaceHolder.resolvePlaceholder("String_Node_Str",null));
  Assert.assertEquals("String_Node_Str",amazonEC2PropertyPlaceHolder.resolvePlaceholder("String_Node_Str",null));
  Assert.assertNull(amazonEC2PropertyPlaceHolder.resolvePlaceholder("String_Node_Str",new Properties()));
}