@Test(expected = CloudRuntimeException.class) public void testFindVirtualProviderWithNullVrProvider() { when(mockNetworkModel.getPhysicalNetworkId(deployment.guestNetwork)).thenReturn(PHYSICAL_NW_ID); final Type type = Type.VirtualRouter; final PhysicalNetworkServiceProviderVO physicalNwSrvProvider = mock(PhysicalNetworkServiceProviderVO.class); when(physicalProviderDao.findByServiceProvider(PHYSICAL_NW_ID, type.toString())) .thenReturn(physicalNwSrvProvider); when(physicalNwSrvProvider.getId()).thenReturn(PROVIDER_ID); when(mockVrProviderDao.findByNspIdAndType(PROVIDER_ID, type)) .thenReturn(null); deployment.findVirtualProvider(); }
protected void findVirtualProvider() { final Type type = Type.VirtualRouter; final Long physicalNetworkId = networkModel.getPhysicalNetworkId(guestNetwork); final PhysicalNetworkServiceProvider provider = physicalProviderDao.findByServiceProvider(physicalNetworkId, type.toString()); if (provider == null) { throw new CloudRuntimeException(String.format("Cannot find service provider %s in physical network %s", type.toString(), physicalNetworkId)); } vrProvider = vrProviderDao.findByNspIdAndType(provider.getId(), type); if (vrProvider == null) { throw new CloudRuntimeException(String.format("Cannot find virtual router provider %s as service provider %s", type.toString(), provider.getId())); } }
RouterDeploymentDefinition { protected void findVirtualProvider() { final Type type = Type.VirtualRouter; final Long physicalNetworkId = networkModel.getPhysicalNetworkId(guestNetwork); final PhysicalNetworkServiceProvider provider = physicalProviderDao.findByServiceProvider(physicalNetworkId, type.toString()); if (provider == null) { throw new CloudRuntimeException(String.format("Cannot find service provider %s in physical network %s", type.toString(), physicalNetworkId)); } vrProvider = vrProviderDao.findByNspIdAndType(provider.getId(), type); if (vrProvider == null) { throw new CloudRuntimeException(String.format("Cannot find virtual router provider %s as service provider %s", type.toString(), provider.getId())); } } }
RouterDeploymentDefinition { protected void findVirtualProvider() { final Type type = Type.VirtualRouter; final Long physicalNetworkId = networkModel.getPhysicalNetworkId(guestNetwork); final PhysicalNetworkServiceProvider provider = physicalProviderDao.findByServiceProvider(physicalNetworkId, type.toString()); if (provider == null) { throw new CloudRuntimeException(String.format("Cannot find service provider %s in physical network %s", type.toString(), physicalNetworkId)); } vrProvider = vrProviderDao.findByNspIdAndType(provider.getId(), type); if (vrProvider == null) { throw new CloudRuntimeException(String.format("Cannot find virtual router provider %s as service provider %s", type.toString(), provider.getId())); } } protected  RouterDeploymentDefinition(final Network guestNetwork, final DeployDestination dest, final Account owner, final Map<Param, Object> params); }
RouterDeploymentDefinition { protected void findVirtualProvider() { final Type type = Type.VirtualRouter; final Long physicalNetworkId = networkModel.getPhysicalNetworkId(guestNetwork); final PhysicalNetworkServiceProvider provider = physicalProviderDao.findByServiceProvider(physicalNetworkId, type.toString()); if (provider == null) { throw new CloudRuntimeException(String.format("Cannot find service provider %s in physical network %s", type.toString(), physicalNetworkId)); } vrProvider = vrProviderDao.findByNspIdAndType(provider.getId(), type); if (vrProvider == null) { throw new CloudRuntimeException(String.format("Cannot find virtual router provider %s as service provider %s", type.toString(), provider.getId())); } } protected  RouterDeploymentDefinition(final Network guestNetwork, final DeployDestination dest, final Account owner, final Map<Param, Object> params); Long getServiceOfferingId(); Long getSecondaryServiceOfferingId(); Vpc getVpc(); Network getGuestNetwork(); DeployDestination getDest(); Account getOwner(); Map<Param, Object> getParams(); boolean isRedundant(); DeploymentPlan getPlan(); boolean isVpcRouter(); Pod getPod(); Long getPodId(); List<DomainRouterVO> getRouters(); VirtualRouterProvider getVirtualProvider(); boolean isBasic(); boolean isPublicNetwork(); PublicIp getSourceNatIP(); boolean needsPublicNic(); boolean hasSourceNatService(); boolean hasGatewayService(); List<DomainRouterVO> deployVirtualRouter(); }
RouterDeploymentDefinition { protected void findVirtualProvider() { final Type type = Type.VirtualRouter; final Long physicalNetworkId = networkModel.getPhysicalNetworkId(guestNetwork); final PhysicalNetworkServiceProvider provider = physicalProviderDao.findByServiceProvider(physicalNetworkId, type.toString()); if (provider == null) { throw new CloudRuntimeException(String.format("Cannot find service provider %s in physical network %s", type.toString(), physicalNetworkId)); } vrProvider = vrProviderDao.findByNspIdAndType(provider.getId(), type); if (vrProvider == null) { throw new CloudRuntimeException(String.format("Cannot find virtual router provider %s as service provider %s", type.toString(), provider.getId())); } } protected  RouterDeploymentDefinition(final Network guestNetwork, final DeployDestination dest, final Account owner, final Map<Param, Object> params); Long getServiceOfferingId(); Long getSecondaryServiceOfferingId(); Vpc getVpc(); Network getGuestNetwork(); DeployDestination getDest(); Account getOwner(); Map<Param, Object> getParams(); boolean isRedundant(); DeploymentPlan getPlan(); boolean isVpcRouter(); Pod getPod(); Long getPodId(); List<DomainRouterVO> getRouters(); VirtualRouterProvider getVirtualProvider(); boolean isBasic(); boolean isPublicNetwork(); PublicIp getSourceNatIP(); boolean needsPublicNic(); boolean hasSourceNatService(); boolean hasGatewayService(); List<DomainRouterVO> deployVirtualRouter();  }