@SuppressWarnings("deprecation")
@Test
public void testExpandReferences() throws Exception {

    subject = new FeatureXmlTransformer(new SilentLog(), new NoopFileLockService());
    Feature feature = Feature
            .read(new File(TestUtil.getBasedir("projects/featureXmlVersionExpansion/"), "feature.xml"));
    TargetPlatform tp = mock(TargetPlatform.class);
    when(tp.resolveArtifact("eclipse-feature", "org.eclipse.rcp", "4.5.0.qualifier")).thenReturn(rcpFeatureInTP);
    when(tp.resolveArtifact("eclipse-plugin", "org.junit4", "4.8.1.qualifier")).thenReturn(junit4InTP);
    when(tp.getArtifactLocation(junit4InTP)).thenReturn(junit4JarLocation);
    subject.expandReferences(feature, tp);
    assertThat(feature.getIncludedFeatures(), hasItem(feature("org.eclipse.rcp", "4.5.0.v20140918")));
    assertThat(feature.getPlugins(), hasItem(plugin("org.junit4", "4.8.1.v20100302")));
    PluginRef plugin = feature.getPlugins().get(0);
    assertThat(plugin.getId(), is("org.junit4"));
    assertThat(plugin.getDownloadSize(), is(1L)); // 1720 bytes rounded to kiB
    assertThat(plugin.getInstallSize(), is(2L)); // 2419 bytes rounded to kiB // TODO shouldn't installSize=downloadSize for unpack=false?
    assertThat(plugin.isUnpack(), is(false));
}