@Test
public void testGetFirewallRules() throws Exception {
for (Resource org1 : restContext.getApi().listOrgs()) {
Org org = api.getOrg(org1.getId());
for (Resource vdc : org.getVDCs()) {
FirewallService response = api.listFirewallRules(org.getId(), vdc.getId());
Set<FirewallRule> firewallRules = response.getFirewallRules();
if (firewallRules != null) {
Iterator<FirewallRule> iter = firewallRules.iterator();
while (iter.hasNext()) {
FirewallRule firewallRule = iter.next();
assertNotNull(firewallRule);
// these are null for firewall rules
assertEquals(response.getHref(), null);
assertEquals(response.getType(), null);
assertNotNull(firewallRule.getFirewallType());
assertNotNull(firewallRule.getProtocol());
assertNotNull(firewallRule.getSource());
assertNotNull(firewallRule.getDestination());
}