use of com.cloud.network.dao.ExternalLoadBalancerDeviceVO in project cloudstack by apache.
the class ExternalLoadBalancerDeviceManagerImplTest method setupLBHealthChecksMocks.
private void setupLBHealthChecksMocks() throws URISyntaxException {
Mockito.when(network.getId()).thenReturn(42l);
Mockito.when(network.getNetworkOfferingId()).thenReturn(1l);
Mockito.when(network.getBroadcastUri()).thenReturn(new URI("vlan://1"));
NetworkExternalLoadBalancerVO externalLb = Mockito.mock(NetworkExternalLoadBalancerVO.class);
Mockito.when(externalLb.getExternalLBDeviceId()).thenReturn(66l);
Mockito.when(_networkExternalLBDao.findByNetworkId(42)).thenReturn(externalLb);
ExternalLoadBalancerDeviceVO lbDevice = Mockito.mock(ExternalLoadBalancerDeviceVO.class);
Mockito.when(_externalLoadBalancerDeviceDao.findById(66l)).thenReturn(lbDevice);
Mockito.when(rule.getAlgorithm()).thenReturn("TEST");
Mockito.when(rule.getProtocol()).thenReturn("TEST");
Mockito.when(rule.getSourceIp()).thenReturn(new Ip(1l));
Mockito.when(lbDevice.getHostId()).thenReturn(99l);
HostVO hostVo = Mockito.mock(HostVO.class);
Mockito.when(_hostDao.findById(Mockito.anyLong())).thenReturn(hostVo);
}
Aggregations