Skip to content

Commit d0e5efd

Browse files
committed
Fix tests
1 parent 7520bed commit d0e5efd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public void offeringRequestedVGpuAndHostDoesNotHaveItTestVGpuRequestedButHostDoe
327327
Mockito.doCallRealMethod().when(excludeList).getHostsToAvoid();
328328
Mockito.doReturn(1L).when(serviceOffering).getId();
329329
Mockito.doReturn(requestedVGpuType).when(serviceOfferingDetailsDao).findDetail(Mockito.anyLong(), Mockito.anyString());
330-
Mockito.doReturn(false).when(resourceManagerMock).isGPUDeviceAvailable(Mockito.anyLong(), Mockito.nullable(String.class), Mockito.nullable(String.class));
330+
Mockito.doReturn(false).when(resourceManagerMock).isGPUDeviceAvailable(Mockito.any(Host.class), Mockito.nullable(String.class), Mockito.nullable(String.class));
331331
boolean result = firstFitAllocatorSpy.offeringRequestedVGpuAndHostDoesNotHaveIt(serviceOffering, excludeList, host1);
332332

333333
Assert.assertTrue(result);
@@ -339,10 +339,9 @@ public void offeringRequestedVGpuAndHostDoesNotHaveItTestVGpuRequestedButHostDoe
339339
public void offeringRequestedVGpuAndHostDoesNotHaveItTestVGpuRequestedAndHostDoesHaveItShouldReturnFalse() {
340340
ServiceOfferingDetailsVO requestedVGpuType = Mockito.mock(ServiceOfferingDetailsVO.class);
341341

342-
Mockito.doReturn(1L).when(host1).getId();
343342
Mockito.doReturn(1L).when(serviceOffering).getId();
344343
Mockito.doReturn(requestedVGpuType).when(serviceOfferingDetailsDao).findDetail(Mockito.anyLong(), Mockito.anyString());
345-
Mockito.doReturn(true).when(resourceManagerMock).isGPUDeviceAvailable(Mockito.anyLong(), Mockito.nullable(String.class), Mockito.nullable(String.class));
344+
Mockito.doReturn(true).when(resourceManagerMock).isGPUDeviceAvailable(Mockito.any(Host.class), Mockito.nullable(String.class), Mockito.nullable(String.class));
346345
boolean result = firstFitAllocatorSpy.offeringRequestedVGpuAndHostDoesNotHaveIt(serviceOffering, excludeList, host1);
347346

348347
Assert.assertFalse(result);

0 commit comments

Comments
 (0)