@Test
public void synchronizeReferencesDoesNotRemoveUrls() throws Exception {

    ArtifactTemplateId artifactTemplateId = new ArtifactTemplateId("http://example.org", "test-artifact-template", false);
    // alternative test implementation: Use git-based repository
    // this test at hand is closer to the implementation, but easier to write
    IRepository repository = mock(IRepository.class);
    ArtifactTemplateFilesDirectoryId artifactTemplateFilesDirectoryId = new ArtifactTemplateFilesDirectoryId(artifactTemplateId);
    when(repository.getContainedFiles(artifactTemplateFilesDirectoryId)).thenReturn(Collections.emptySortedSet());
    TArtifactTemplate artifactTemplate = createArtifactTemplateWithSingleReferenceToAnUrl();
    when(repository.getElement(artifactTemplateId)).thenReturn(artifactTemplate);
    TArtifactTemplate synchronizhedArtifactTemplate = BackendUtils.synchronizeReferences(repository, artifactTemplateId);
    assertEquals(createArtifactTemplateWithSingleReferenceToAnUrl(), synchronizhedArtifactTemplate);
}