@Test public void testFindOfferingIdDefault() { final VpcOfferingVO vpcOffering = mock(VpcOfferingVO.class); when(mockVpcOffDao.findById(VPC_OFFERING_ID)).thenReturn(vpcOffering); when(vpcOffering.getServiceOfferingId()).thenReturn(null); when(mockServiceOfferingDao.findDefaultSystemOffering(Matchers.anyString(), Matchers.anyBoolean())).thenReturn(mockSvcOfferingVO); when(mockSvcOfferingVO.getId()).thenReturn(DEFAULT_OFFERING_ID); deployment.findServiceOfferingId(); assertEquals("Since there is no service offering associated with VPC offering, offering id should have matched default one", DEFAULT_OFFERING_ID, deployment.serviceOfferingId.longValue()); }
@Override protected void findServiceOfferingId() { serviceOfferingId = vpcOffDao.findById(vpc.getVpcOfferingId()).getServiceOfferingId(); if (serviceOfferingId == null) { findDefaultServiceOfferingId(); } }
VpcRouterDeploymentDefinition extends RouterDeploymentDefinition { @Override protected void findServiceOfferingId() { serviceOfferingId = vpcOffDao.findById(vpc.getVpcOfferingId()).getServiceOfferingId(); if (serviceOfferingId == null) { findDefaultServiceOfferingId(); } } }
VpcRouterDeploymentDefinition extends RouterDeploymentDefinition { @Override protected void findServiceOfferingId() { serviceOfferingId = vpcOffDao.findById(vpc.getVpcOfferingId()).getServiceOfferingId(); if (serviceOfferingId == null) { findDefaultServiceOfferingId(); } } protected  VpcRouterDeploymentDefinition(final Network guestNetwork, final Vpc vpc, final DeployDestination dest, final Account owner,
                                            final Map<Param, Object> params); }
VpcRouterDeploymentDefinition extends RouterDeploymentDefinition { @Override protected void findServiceOfferingId() { serviceOfferingId = vpcOffDao.findById(vpc.getVpcOfferingId()).getServiceOfferingId(); if (serviceOfferingId == null) { findDefaultServiceOfferingId(); } } protected  VpcRouterDeploymentDefinition(final Network guestNetwork, final Vpc vpc, final DeployDestination dest, final Account owner,
                                            final Map<Param, Object> params); @Override Vpc getVpc(); @Override boolean isVpcRouter(); @Override boolean needsPublicNic(); @Override boolean hasSourceNatService(); boolean hasGatewayService(); @Override void generateDeploymentPlan(); @Override boolean isRedundant(); }
VpcRouterDeploymentDefinition extends RouterDeploymentDefinition { @Override protected void findServiceOfferingId() { serviceOfferingId = vpcOffDao.findById(vpc.getVpcOfferingId()).getServiceOfferingId(); if (serviceOfferingId == null) { findDefaultServiceOfferingId(); } } protected  VpcRouterDeploymentDefinition(final Network guestNetwork, final Vpc vpc, final DeployDestination dest, final Account owner,
                                            final Map<Param, Object> params); @Override Vpc getVpc(); @Override boolean isVpcRouter(); @Override boolean needsPublicNic(); @Override boolean hasSourceNatService(); boolean hasGatewayService(); @Override void generateDeploymentPlan(); @Override boolean isRedundant();  }