@Test
public void testFetchIf() throws IOException {

    Fongo fongo = new Fongo("Mongo DB");
    Discoverer d = new Discoverer(fongo.getMongo());
    ArrayList<String> offeringNames = new ArrayList<String>();
    offeringNames.add("EC2");
    offeringNames.add("Azure");
    offeringNames.add("Openshift");
    for (String name: offeringNames) {
        d.addOffering(new Offering(name));
    }
    Offering of = new Offering("Example");
    of.addProperty("num_cpus", "8");
    d.addOffering(of);
    ArrayList<DiscovererAPI.OfferingRepresentation> offerings = (new DiscovererAPI(d)).getOfferingsIf("{ \"num_cpus\": \"8\" }");
    Assert.assertEquals(offerings.size(), 1);
    String fetchedOffering = offerings.get(0).getOffering();
    Assert.assertEquals(fetchedOffering, of.toTosca());
}