6565
6666import static org .mockito .ArgumentMatchers .any ;
6767import static org .mockito .ArgumentMatchers .anyLong ;
68- import static org .mockito .Mockito .when ;
69- import static org .mockito .Mockito .nullable ;
70- import static org .mockito .Mockito .anyBoolean ;
71- import static org .mockito .Mockito .anyMap ;
72- import static org .mockito .Mockito .anyString ;
73- import static org .mockito .Mockito .anyInt ;
74- import static org .mockito .Mockito .anyList ;
75- import static org .mockito .Mockito .verify ;
76- import static org .mockito .Mockito .times ;
77- import static org .mockito .Mockito .doNothing ;
68+ import static org .mockito .Mockito .*;
7869
7970@ RunWith (MockitoJUnitRunner .class )
8071public class ConfigurationManagerImplTest {
@@ -364,7 +355,7 @@ public void testDeleteZoneInvokesDeleteNsxProviderWhenNSXIsEnabled() {
364355
365356 when (nsxProviderDao .findByZoneId (anyLong ())).thenReturn (nsxProviderVO );
366357 when (zoneDao .findById (anyLong ())).thenReturn (dataCenterVO );
367- when (hostDao .findByDataCenterId (anyLong ())).thenReturn (Collections .emptyList ());
358+ lenient (). when (hostDao .findByDataCenterId (anyLong ())).thenReturn (Collections .emptyList ());
368359 when (podDao .listByDataCenterId (anyLong ())).thenReturn (Collections .emptyList ());
369360 when (ipAddressDao .countIPs (anyLong (), anyBoolean ())).thenReturn (0 );
370361 when (publicIpAddressDao .countIPs (anyLong (), anyBoolean ())).thenReturn (0 );
@@ -377,7 +368,7 @@ public void testDeleteZoneInvokesDeleteNsxProviderWhenNSXIsEnabled() {
377368 when (zoneDao .remove (anyLong ())).thenReturn (true );
378369 when (capacityDao .removeBy (nullable (Short .class ), anyLong (), nullable (Long .class ), nullable (Long .class ), nullable (Long .class ))).thenReturn (true );
379370 when (dedicatedResourceDao .findByZoneId (anyLong ())).thenReturn (null );
380- when (annotationDao .removeByEntityType (anyString (), anyString ())).thenReturn (true );
371+ lenient (). when (annotationDao .removeByEntityType (anyString (), anyString ())).thenReturn (true );
381372
382373 configurationManagerImplSpy .deleteZone (deleteZoneCmd );
383374
@@ -393,13 +384,13 @@ public void testCreateNetworkOfferingForNsx() {
393384 when (createNetworkOfferingCmd .getTraffictype ()).thenReturn (Networks .TrafficType .Guest .name ());
394385 when (createNetworkOfferingCmd .getGuestIpType ()).thenReturn (Network .GuestType .Isolated .name ());
395386 when (createNetworkOfferingCmd .getAvailability ()).thenReturn (NetworkOffering .Availability .Optional .name ());
396- when (configurationManagerImplSpy .createNetworkOffering (anyString (), anyString (), any (Networks .TrafficType .class ), anyString (),
387+ lenient (). when (configurationManagerImplSpy .createNetworkOffering (anyString (), anyString (), any (Networks .TrafficType .class ), anyString (),
397388 anyBoolean (), any (NetworkOffering .Availability .class ), anyInt (), anyMap (), anyBoolean (), any (Network .GuestType .class ),
398389 anyBoolean (), anyLong (), anyBoolean (), anyMap (), anyBoolean (), anyBoolean (), anyMap (), anyBoolean (), anyInt (),
399390 anyBoolean (), anyBoolean (), anyBoolean (), anyBoolean (), anyString (), anyList (), anyList (), anyBoolean (), any (NetUtils .InternetProtocol .class )))
400391 .thenReturn (offeringVO );
401392 when (configDao .getValue (anyString ())).thenReturn ("1000" );
402- when (networkOfferingDao .persist (any (NetworkOfferingVO .class ), anyMap ())).thenReturn (offeringVO );
393+ lenient (). when (networkOfferingDao .persist (any (NetworkOfferingVO .class ), anyMap ())).thenReturn (offeringVO );
403394 doNothing ().when (networkService ).validateIfServiceOfferingIsActiveAndSystemVmTypeIsDomainRouter (anyLong ());
404395 doNothing ().when (networkModel ).canProviderSupportServices (anyMap ());
405396
0 commit comments