cloudstack/server/src/test/java/com/cloud
Eric Kalendra 55c811547a
Update Mockito to 5.16.1 (#10686)
Dependency name change mockito-inline to mockito-core. Inline is now the default and the last version of mockito-inline released is 5.2.0.

assertj-core in user-authenticators/saml2 pulls in an incompatible version of byte-buddy and required an exclusion. Updating the version of assertj is left for a future PR.
The upgrade requires Java 11+, dropping support for Java 8. CloudStack documentation already says to use Java 11 and does not indicate that java 8 is supported.

Test classes using @RunWith(MockitoJUnitRunner.class) now get run in strict mode. Changes were made to tests where the stubbing intention was clear. In ManagementServerMaintenanceManagerImplTest there are 5 tests where the intention of the test is unclear. Each of the statements now use Mockito.lenient() to avoid the exception. Other cases in the tests follow a similar pattern.
Minor clean up.

Both @Spy and Mockito.spy( should not be used. Favored the annotation.
Both @RunWith(MockitoJUnitRunner.class) and MockitoAnnotations.openMocks(this); should not be used. Favored the annotation.
Unnecessary extends TestCase removed.
@InjectMocks and new in statement unnecessary. Removed new when issue presented.
Some of the Cmd classes like UpdateNetworkCmd have a type tree that includes fields of type Object. This appears to cause issues with injection, requiring that @Mock fields be available. This is where the following fields were added in multiple places:
Object job;
ResponseGenerator _responseGenerator;
Wrong number of parameters for Mockito.when in LibvirtRevertSnapshotCommandWrapperTest.java
2025-04-16 18:10:28 +05:30
..
acl server, api: account and api entity access improvements 2024-08-06 12:24:19 -03:00
alert Fixup alerting and logging error in BGPServiceImpl (#10252) 2025-02-18 09:23:43 -05:00
api Update Mockito to 5.16.1 (#10686) 2025-04-16 18:10:28 +05:30
bgp Routed mode: minor improvements and fixes (#9697) 2024-11-30 08:45:15 +01:00
capacity api,agent,server,engine-schema: scalability improvements (#9840) 2025-02-01 12:28:41 +05:30
configuration Support multi-scope configuration settings (#10300) 2025-02-14 11:25:01 +05:30
consoleproxy Normalize loggers and upgrade log4j 1.2 to log4j 2.19 (#7131) 2024-02-08 09:55:41 -03:00
deploy api,agent,server,engine-schema: scalability improvements (#9840) 2025-02-01 12:28:41 +05:30
event Merge branch '4.19' 2024-07-17 17:43:40 +05:30
ha server: investigate pending HA work when executing in new MS session (#10167) 2025-01-28 14:39:31 +05:30
hypervisor Merge branch '4.19' 2024-06-25 18:53:57 +05:30
keystore Normalize loggers and upgrade log4j 1.2 to log4j 2.19 (#7131) 2024-02-08 09:55:41 -03:00
metadata Upgrade to mockito 4 and handle Mockito deprecations (#8427) 2024-02-06 14:20:37 +01:00
network Update Mockito to 5.16.1 (#10686) 2025-04-16 18:10:28 +05:30
projects Improve logging to include more identifiable information (#9873) 2025-01-06 16:42:37 +05:30
resource Merge branch '4.20' 2025-02-01 21:20:08 +01:00
resourceicon Remove powermock from server (#7986) 2023-09-22 14:07:08 +02:00
resourcelimit Update Mockito to 5.16.1 (#10686) 2025-04-16 18:10:28 +05:30
server Support multi-scope configuration settings (#10300) 2025-02-14 11:25:01 +05:30
servlet CLOUDSTACK-10105: Use maven standard project structure in all projects (#2283) 2018-01-20 03:19:27 +05:30
snapshot Remove powermock from server (#7986) 2023-09-22 14:07:08 +02:00
storage Launch RESIZE event on volume snapshot revert (#10482) 2025-04-15 09:49:53 +02:00
tags Remove powermock from server (#7986) 2023-09-22 14:07:08 +02:00
template Improve logging to include more identifiable information (#9873) 2025-01-06 16:42:37 +05:30
user Update Mockito to 5.16.1 (#10686) 2025-04-16 18:10:28 +05:30
vm Merge branch '4.19' into 4.20 2025-02-01 17:51:50 +01:00
vpc Support multi-scope configuration settings (#10300) 2025-02-14 11:25:01 +05:30