Discoverer { public boolean removeOffering(String cloudOfferingId) { return Offering.validateOfferingId(cloudOfferingId) && offeringManager.removeOffering(cloudOfferingId); } Discoverer(MongoClient mongoClient, ArrayList<String> activeCrawlers);  Discoverer(MongoClient mongoClient); synchronized void setRefreshing(boolean refreshing); synchronized boolean getRefreshing(); Offering fetchOffer(String cloudOfferingId); String addOffering(Offering newOffering); boolean removeOffering(String cloudOfferingId); Collection<String> getAllOfferingIds(); void generateSingleOffering(); void refreshRepository(); public int totalCrawledOfferings; public int crawledTimes; public Date lastCrawl; public OfferingManager offeringManager; }
@Test public void testRemoveOffering() { Fongo fongo = new Fongo("Mongo DB"); Discoverer d = new Discoverer(fongo.getMongo()); String ofId = "NonPresentOfferings"; Assert.assertFalse(d.removeOffering(ofId)); ofId = "EC2"; d.addOffering(new Offering(ofId)); Assert.assertTrue(d.removeOffering(ofId)); }