Skip to content

Commit 5ff9e48

Browse files
committed
Fix test timeout
1 parent 341848c commit 5ff9e48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

engine/storage/image/src/test/java/org/apache/cloudstack/storage/image/SecondaryStorageServiceImplTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public void templateIsOnDestinationTestReturnsFalseWhenTemplateIsNotReady() {
105105
public void templateIsOnDestinationTestReturnsTrueIfTemplateIsDownloadedSuccessfully() {
106106
prepareForTemplateIsOnDestinationTests();
107107
Mockito.when(templateDataStoreVoMock.getDownloadState()).thenReturn(VMTemplateStorageResourceAssoc.Status.DOWNLOAD_IN_PROGRESS);
108-
Mockito.doAnswer(I -> Mockito.when(templateDataStoreVoMock.getDownloadState()).thenReturn(VMTemplateStorageResourceAssoc.Status.DOWNLOADED)).when(secondaryStorageService).waitForTemplateDownload(Mockito.anyInt(), Mockito.anyString(), Mockito.anyString());
108+
Mockito.doAnswer(I -> Mockito.when(templateDataStoreVoMock.getDownloadState()).thenReturn(VMTemplateStorageResourceAssoc.Status.DOWNLOADED)).when(secondaryStorageService).waitForTemplateDownload(Mockito.anyLong(), Mockito.anyString(), Mockito.anyString());
109109

110110
boolean result = secondaryStorageService.templateIsOnDestination(templateInfoMock, dataStoreMock);
111111

@@ -120,7 +120,7 @@ public void templateIsOnDestinationTestReturnsFalseIfTemplateIsNotDownloadedSucc
120120
Mockito.when(templateDataStoreVoMock.getDownloadState()).thenReturn(VMTemplateStorageResourceAssoc.Status.DOWNLOAD_ERROR);
121121
Mockito.when(templateDataStoreVoMock.getState()).thenReturn(ObjectInDataStoreStateMachine.State.Failed);
122122
return "mocked download fail";
123-
}).when(secondaryStorageService).waitForTemplateDownload(Mockito.anyInt(), Mockito.anyString(), Mockito.anyString());
123+
}).when(secondaryStorageService).waitForTemplateDownload(Mockito.anyLong(), Mockito.anyString(), Mockito.anyString());
124124

125125
boolean result = secondaryStorageService.templateIsOnDestination(templateInfoMock, dataStoreMock);
126126

0 commit comments

Comments
 (0)