File tree Expand file tree Collapse file tree
plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity
org/apache/cloudstack/networkoffering Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444import com .cloud .exception .AffinityConflictException ;
4545import com .cloud .host .HostVO ;
4646import com .cloud .host .dao .HostDao ;
47+ import com .cloud .utils .db .DB ;
4748import com .cloud .utils .db .SearchBuilder ;
4849import com .cloud .utils .db .SearchCriteria ;
4950import com .cloud .utils .db .Transaction ;
@@ -406,6 +407,7 @@ public boolean canBeSharedDomainWide() {
406407 return true ;
407408 }
408409
410+ @ DB
409411 @ Override
410412 public void handleDeleteGroup (AffinityGroup group ) {
411413 // When a group of the 'ExplicitDedication' type gets deleted, make sure
Original file line number Diff line number Diff line change 5454import com .cloud .deploy .dao .PlannerHostReservationDao ;
5555
5656import org .apache .cloudstack .affinity .AffinityGroupProcessor ;
57+ import org .apache .cloudstack .affinity .AffinityGroupService ;
5758import org .apache .cloudstack .affinity .dao .AffinityGroupDao ;
5859import org .apache .cloudstack .affinity .dao .AffinityGroupVMMapDao ;
5960import org .apache .cloudstack .engine .cloud .entity .api .db .dao .VMReservationDao ;
@@ -366,6 +367,11 @@ public VMReservationDao reservationDao() {
366367 return Mockito .mock (VMReservationDao .class );
367368 }
368369
370+ @ Bean
371+ public AffinityGroupService affinityGroupService () {
372+ return Mockito .mock (AffinityGroupService .class );
373+ }
374+
369375 public static class Library implements TypeFilter {
370376
371377 @ Override
Original file line number Diff line number Diff line change 1919
2020import java .io .IOException ;
2121
22+ import javax .inject .Inject ;
23+
24+ import org .apache .cloudstack .acl .SecurityChecker ;
25+ import org .apache .cloudstack .affinity .AffinityGroupService ;
26+ import org .apache .cloudstack .affinity .dao .AffinityGroupDao ;
27+ import org .apache .cloudstack .region .PortableIpDaoImpl ;
28+ import org .apache .cloudstack .region .dao .RegionDaoImpl ;
29+ import org .apache .cloudstack .storage .datastore .db .PrimaryDataStoreDaoImpl ;
30+ import org .apache .cloudstack .test .utils .SpringUtils ;
2231import org .mockito .Mockito ;
2332import org .springframework .context .annotation .Bean ;
2433import org .springframework .context .annotation .ComponentScan ;
@@ -359,6 +368,16 @@ public DataStoreManager dataStoreManager() {
359368 return Mockito .mock (DataStoreManager .class );
360369 }
361370
371+ @ Bean
372+ public AffinityGroupDao affinityGroupDao () {
373+ return Mockito .mock (AffinityGroupDao .class );
374+ }
375+
376+ @ Bean
377+ public AffinityGroupService affinityGroupService () {
378+ return Mockito .mock (AffinityGroupService .class );
379+ }
380+
362381 public static class Library implements TypeFilter {
363382
364383 @ Override
You can’t perform that action at this time.
0 commit comments