4747import com .cloud .hypervisor .Hypervisor ;
4848import com .cloud .hypervisor .HypervisorGuruManager ;
4949import com .cloud .hypervisor .dao .HypervisorCapabilitiesDao ;
50+ import com .cloud .service .dao .ServiceOfferingDetailsDao ;
5051import com .cloud .storage .GuestOSVO ;
5152import com .cloud .storage .Snapshot ;
5253import com .cloud .storage .SnapshotVO ;
@@ -104,6 +105,8 @@ public class VMSnapshotManagerTest {
104105 ConfigurationDao _configDao ;
105106 @ Mock
106107 HypervisorCapabilitiesDao _hypervisorCapabilitiesDao ;
108+ @ Mock
109+ ServiceOfferingDetailsDao _serviceOfferingDetailsDao ;
107110 int _vmSnapshotMax = 10 ;
108111
109112 private static final long TEST_VM_ID = 3L ;
@@ -124,6 +127,7 @@ public void setup() {
124127 _vmSnapshotMgr ._snapshotDao = _snapshotDao ;
125128 _vmSnapshotMgr ._guestOSDao = _guestOSDao ;
126129 _vmSnapshotMgr ._hypervisorCapabilitiesDao = _hypervisorCapabilitiesDao ;
130+ _vmSnapshotMgr ._serviceOfferingDetailsDao = _serviceOfferingDetailsDao ;
127131
128132 doNothing ().when (_accountMgr ).checkAccess (any (Account .class ), any (AccessType .class ), any (Boolean .class ), any (ControlledEntity .class ));
129133
@@ -133,6 +137,7 @@ public void setup() {
133137 when (_vmSnapshotDao .findByName (anyLong (), anyString ())).thenReturn (null );
134138 when (_vmSnapshotDao .findByVm (anyLong ())).thenReturn (new ArrayList <VMSnapshotVO >());
135139 when (_hypervisorCapabilitiesDao .isVmSnapshotEnabled (Hypervisor .HypervisorType .XenServer , "default" )).thenReturn (true );
140+ when (_serviceOfferingDetailsDao .findDetail (anyLong (), anyString ())).thenReturn (null );
136141
137142 List <VolumeVO > mockVolumeList = new ArrayList <VolumeVO >();
138143 mockVolumeList .add (volumeMock );
0 commit comments