mirror of https://github.com/apache/cloudstack.git
Fix tests
This commit is contained in:
parent
1fa220f403
commit
2ee399681a
|
|
@ -103,7 +103,7 @@ public class NsxElement extends AdapterBase implements DhcpServiceProvider, DnsS
|
|||
@Inject
|
||||
DomainDao domainDao;
|
||||
@Inject
|
||||
private VpcOfferingServiceMapDao vpcOfferingServiceMapDao;
|
||||
protected VpcOfferingServiceMapDao vpcOfferingServiceMapDao;
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(NsxElement.class);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.cloud.network.dao.NetworkDao;
|
|||
import com.cloud.network.dao.PhysicalNetworkDao;
|
||||
import com.cloud.network.dao.PhysicalNetworkVO;
|
||||
import com.cloud.network.vpc.Vpc;
|
||||
import com.cloud.network.vpc.dao.VpcOfferingServiceMapDao;
|
||||
import com.cloud.resource.ResourceManager;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.AccountManager;
|
||||
|
|
@ -42,6 +43,7 @@ import org.mockito.junit.MockitoJUnitRunner;
|
|||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyBoolean;
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.ArgumentMatchers.anyLong;
|
||||
|
|
@ -75,6 +77,8 @@ public class NsxElementTest {
|
|||
Account account;
|
||||
@Mock
|
||||
DomainVO domain;
|
||||
@Mock
|
||||
private VpcOfferingServiceMapDao vpcOfferingServiceMapDao;
|
||||
|
||||
NsxElement nsxElement;
|
||||
ReservationContext reservationContext;
|
||||
|
|
@ -94,6 +98,7 @@ public class NsxElementTest {
|
|||
nsxElement.physicalNetworkDao = physicalNetworkDao;
|
||||
nsxElement.domainDao = domainDao;
|
||||
nsxElement.networkModel = networkModel;
|
||||
nsxElement.vpcOfferingServiceMapDao = vpcOfferingServiceMapDao;
|
||||
reservationContext = mock(ReservationContext.class);
|
||||
deployDestination = mock(DeployDestination.class);
|
||||
|
||||
|
|
@ -106,6 +111,8 @@ public class NsxElementTest {
|
|||
when(domainDao.findById(anyLong())).thenReturn(domain);
|
||||
when(vpc.getZoneId()).thenReturn(1L);
|
||||
when(vpc.getName()).thenReturn("testVPC");
|
||||
when(vpc.getVpcOfferingId()).thenReturn(1L);
|
||||
when(vpcOfferingServiceMapDao.areServicesSupportedByVpcOffering(anyLong(), any())).thenReturn(false);
|
||||
|
||||
PhysicalNetworkVO physicalNetworkVO = new PhysicalNetworkVO();
|
||||
physicalNetworkVO.setIsolationMethods(List.of("NSX"));
|
||||
|
|
|
|||
Loading…
Reference in New Issue