@Test
public void testGetImportingBundles() throws IOException {

    ExportedPackage exported = Mockito.mock(ExportedPackage.class);
    Bundle bundle = Mockito.mock(Bundle.class);
    Bundle exportingBundle = Mockito.mock(Bundle.class);
    Mockito.when(exported.getVersion()).thenReturn(Version.parseVersion("1.0.0"));
    Mockito.when(exported.getExportingBundle()).thenReturn(exportingBundle);
    Mockito.when(exportingBundle.getBundleId()).thenReturn(Long.valueOf(2));
    Mockito.when(exported.getImportingBundles()).thenReturn(new Bundle[]{bundle});
    Mockito.when(bundle.getBundleId()).thenReturn(Long.valueOf(4));
    Mockito.when(admin.getExportedPackages(Mockito.anyString())).thenReturn(new ExportedPackage[]{exported});
    long[] ids = mbean.getImportingBundles("test", "1.0.0", 2);
    Assert.assertArrayEquals(new long[]{4}, ids);
}