Program: 20679
Project: 20679
Buggy source:
@Test public void testMergeWithOutConflictArtifacts() throws Exception {
  String sourceRepoId="String_Node_Str";
  ArtifactMetadata artifact1=new ArtifactMetadata();
  artifact1.setNamespace("String_Node_Str");
  artifact1.setProject("String_Node_Str");
  artifact1.setVersion("String_Node_Str");
  artifact1.setProjectVersion("String_Node_Str");
  artifact1.setId("String_Node_Str");
  artifact1.setRepositoryId(sourceRepoId);
  List<ArtifactMetadata> sourceRepoArtifactsList=getArtifacts();
  sourceRepoArtifactsList.add(artifact1);
  List<ArtifactMetadata> targetRepoArtifactsList=getArtifacts();
  Configuration c=new Configuration();
  ManagedRepositoryConfiguration testRepo=new ManagedRepositoryConfiguration();
  testRepo.setId(TEST_REPO_ID);
  testRepo.setLocation("String_Node_Str");
  String sourceRepo="String_Node_Str";
  ManagedRepositoryConfiguration testRepoWithConflicts=new ManagedRepositoryConfiguration();
  testRepoWithConflicts.setId(sourceRepoId);
  testRepoWithConflicts.setLocation(sourceRepo);
  RepositoryScanningConfiguration repoScanConfig=new RepositoryScanningConfiguration();
  List<String> knownContentConsumers=new ArrayList<String>();
  knownContentConsumers.add("String_Node_Str");
  repoScanConfig.setKnownContentConsumers(knownContentConsumers);
  c.setRepositoryScanning(repoScanConfig);
  c.addManagedRepository(testRepo);
  c.addManagedRepository(testRepoWithConflicts);
  configuration.save(c);
  File targetRepoFile=new File("String_Node_Str");
  targetRepoFile.setReadOnly();
  when(metadataRepository.getArtifacts(sourceRepoId)).thenReturn(sourceRepoArtifactsList);
  when(metadataRepository.getArtifacts(TEST_REPO_ID)).thenReturn(targetRepoArtifactsList);
  assertEquals(1,repositoryMerger.getConflictingArtifacts(metadataRepository,sourceRepoId,TEST_REPO_ID).size());
  verify(metadataRepository).getArtifacts(TEST_REPO_ID);
}

Fixed version (ground truth):
@Test public void testMergeWithOutConflictArtifacts() throws Exception {
  String sourceRepoId="String_Node_Str";
  ArtifactMetadata artifact1=new ArtifactMetadata();
  artifact1.setNamespace("String_Node_Str");
  artifact1.setProject("String_Node_Str");
  artifact1.setVersion("String_Node_Str");
  artifact1.setProjectVersion("String_Node_Str");
  artifact1.setId("String_Node_Str");
  artifact1.setRepositoryId(sourceRepoId);
  List<ArtifactMetadata> sourceRepoArtifactsList=getArtifacts();
  sourceRepoArtifactsList.add(artifact1);
  List<ArtifactMetadata> targetRepoArtifactsList=getArtifacts();
  Configuration c=new Configuration();
  ManagedRepositoryConfiguration testRepo=new ManagedRepositoryConfiguration();
  testRepo.setId(TEST_REPO_ID);
  testRepo.setLocation("String_Node_Str" + File.separatorChar + "String_Node_Str");
  String sourceRepo="String_Node_Str" + File.separatorChar + "String_Node_Str"+ File.separatorChar+ "String_Node_Str"+ File.separatorChar+ "String_Node_Str";
  ManagedRepositoryConfiguration testRepoWithConflicts=new ManagedRepositoryConfiguration();
  testRepoWithConflicts.setId(sourceRepoId);
  testRepoWithConflicts.setLocation(sourceRepo);
  RepositoryScanningConfiguration repoScanConfig=new RepositoryScanningConfiguration();
  List<String> knownContentConsumers=new ArrayList<String>();
  knownContentConsumers.add("String_Node_Str");
  repoScanConfig.setKnownContentConsumers(knownContentConsumers);
  c.setRepositoryScanning(repoScanConfig);
  c.addManagedRepository(testRepo);
  c.addManagedRepository(testRepoWithConflicts);
  configuration.save(c);
  File targetRepoFile=new File("String_Node_Str");
  targetRepoFile.setReadOnly();
  when(metadataRepository.getArtifacts(sourceRepoId)).thenReturn(sourceRepoArtifactsList);
  when(metadataRepository.getArtifacts(TEST_REPO_ID)).thenReturn(targetRepoArtifactsList);
  assertEquals(1,repositoryMerger.getConflictingArtifacts(metadataRepository,sourceRepoId,TEST_REPO_ID).size());
  verify(metadataRepository).getArtifacts(TEST_REPO_ID);
}