@Test
public void testFindElbVmWithCapacityWhenThereAreUnusedElbVmsAndOneMatchesThePodId() throws Exception {
Long podId = 1L;
IPAddressVO ipAddrMock = mock(IPAddressVO.class);
when(ipAddrMock.getVlanId()).thenReturn(podId);
PodVlanMapVO podVlanMapVoMock = mock(PodVlanMapVO.class);
when(podVlanMapVoMock.getPodId()).thenReturn(podId);
when(podVlanMapDao.listPodVlanMapsByVlan(podId)).thenReturn(podVlanMapVoMock);
DomainRouterVO unusedElbVmThatMatchesPodId = mock(DomainRouterVO.class);
when(unusedElbVmThatMatchesPodId.getPodIdToDeployIn()).thenReturn(podId);
List<DomainRouterVO> unusedElbVms = Arrays.asList(new DomainRouterVO[] {unusedElbVmThatMatchesPodId, mock(DomainRouterVO.class)});
when(this.elasticLbVmMapDao.listUnusedElbVms()).thenReturn(unusedElbVms);