use of org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService in project cloudstack by apache.
the class FirewallManagerTest method testApplyRules.
@Ignore("Requires database to be set up")
@Test
public void testApplyRules() {
List<FirewallRuleVO> ruleList = new ArrayList<FirewallRuleVO>();
FirewallRuleVO rule = new FirewallRuleVO("rule1", 1, 80, "TCP", 1, 2, 1, FirewallRule.Purpose.Firewall, null, null, null, null);
ruleList.add(rule);
FirewallManagerImpl firewallMgr = (FirewallManagerImpl) _firewallMgr;
NetworkOrchestrationService netMgr = mock(NetworkOrchestrationService.class);
IpAddressManager addrMgr = mock(IpAddressManager.class);
firewallMgr._networkMgr = netMgr;
try {
firewallMgr.applyRules(ruleList, false, false);
verify(addrMgr).applyRules(any(List.class), any(FirewallRule.Purpose.class), any(NetworkRuleApplier.class), anyBoolean());
} catch (ResourceUnavailableException e) {
Assert.fail("Unreachable code");
}
}
Aggregations