@Test
public void initWithAgentDiscoveryAndUrlLookup() throws ServletException, IOException {

    checkMulticastAvailable();
    prepareStandardInitialisation(ConfigKey.DISCOVERY_ENABLED.getKeyValue(), "true");
    try {
        JolokiaDiscovery discovery = new JolokiaDiscovery("test", new QuietLogHandler());
        List<JSONObject> in = discovery.lookupAgents();
        assertTrue(in.size() > 0);
        // At least one doesnt have an URL (remove this part if a way could be found for getting
        // to the URL
        for (JSONObject json : in) {
            if (json.get("url") == null) {
                return;
            }
        }
        fail("Every message has an URL");
    } finally {
        servlet.destroy();
    }
}