// JULIET supports the following headers:
HeaderManager headerManager = connection1.getExtensionManager(HeaderManager.class);
headerManager.getSupportedHeaders().add("In-Reply-To");
headerManager.getSupportedHeaders().add("Keywords");
ServiceDiscoveryManager serviceDiscoveryManager = connection2.getExtensionManager(ServiceDiscoveryManager.class);
InfoNode infoNode = null;
try {
infoNode = serviceDiscoveryManager.discoverInformation(JULIET);
} catch (StanzaException e) {
Assert.fail();
}
// By default headers are not support, unless they are enabled.
Assert.assertFalse(infoNode.getFeatures().contains(new Feature("http://jabber.org/protocol/shim")));
try {
serviceDiscoveryManager.discoverInformation(JULIET, "http://jabber.org/protocol/shim");
} catch (StanzaException e) {
Assert.assertTrue(e.getStanza().getError().getCondition() instanceof ItemNotFound);
return;
}
Assert.fail();