Fix UnnecessaryStubbingException

This commit is contained in:
Harikrishna Patnala 2026-05-13 14:25:04 +05:30
parent a3c2e06a58
commit e94dd7b457
1 changed files with 0 additions and 19 deletions

View File

@ -442,7 +442,6 @@ public class FirewallManagerTest {
Map<Service, Map<Capability, String>> providerCapabilities = new HashMap<>();
providerCapabilities.put(Service.Firewall, firewallCaps);
when(network.getId()).thenReturn(1L);
when(network.getVpcId()).thenReturn(10L);
when(fwProvider.getProvider()).thenReturn(Network.Provider.VPCVirtualRouter);
when(fwProvider.getCapabilities()).thenReturn(providerCapabilities);
@ -591,24 +590,6 @@ public class FirewallManagerTest {
verify(_accountMgr, times(1)).checkAccess(caller, null, true, ipAddress);
}
@Test
public void testCreateIngressFirewallRuleRoutesToVpcMethodWhenIpHasVpcId() throws NetworkRuleConflictException {
FirewallRule rule = Mockito.mock(FirewallRule.class);
IPAddressVO ipAddress = Mockito.mock(IPAddressVO.class);
when(rule.getSourceIpAddressId()).thenReturn(1L);
when(ipAddress.getVpcId()).thenReturn(10L);
doReturn(ipAddress).when(_firewallMgr).getSourceIpForIngressRule(1L);
doReturn(rule).when(_firewallMgr).createIngressFirewallRuleForVpcIp(rule, null, ipAddress);
doReturn(rule).when(_firewallMgr).createIngressFirewallRuleForVpcIp(
Mockito.eq(rule), Mockito.any(), Mockito.eq(ipAddress));
verify(_firewallMgr, never()).createIngressFirewallRuleForIsolatedIp(
Mockito.any(), Mockito.any(), Mockito.any());
}
@Test
public void testCreateFirewallRuleRoutesToVpcWhenVpcIdProvided() throws NetworkRuleConflictException {
Account caller = Mockito.mock(Account.class);