RepositoryStorageVFSImpl extends InMemoryRepositoryStorage<ServiceTasksConfiguration> { public void onSpaceDeleted(@Observes RepoRemovedFromOrganizationalUnitEvent deletedEvent) { uninstallOnRepositoryRemoved(deletedEvent.getRepository()); } RepositoryStorageVFSImpl(); @Inject  RepositoryStorageVFSImpl( @Named("configIO") final IOService ioService, @Named("systemFS") final FileSystem fileSystem ); @SuppressWarnings("unchecked") @PostConstruct void init(); @Override List<RepoData> synchronizeServices(List<RepoData> currentServices); @Override void onAdded(RepoData service); @Override void onEnabled(RepoData service); @Override void onDisabled(RepoData service); @Override void onInstalled(RepoData service, String target); @Override void onUninstalled(RepoData service, String target); @Override ServiceTasksConfiguration loadConfiguration(); @Override void storeConfiguration(ServiceTasksConfiguration configuration); void onProjectDeleted(@Observes RepositoryRemovedEvent deletedEvent); void onSpaceDeleted(@Observes RepoRemovedFromOrganizationalUnitEvent deletedEvent);  }
@Test public void testOnSpaceRemoved() { assertEquals(1, service.getInstalledOn().size()); when(repo.getUri()).thenReturn("default: when(spaceRepositoryRemovedEvent.getRepository()).thenReturn(repo); storage.onSpaceDeleted(spaceRepositoryRemovedEvent); assertEquals(0, service.getInstalledOn().size()); }