2626import org .apache .cloudstack .backup .backroll .BackrollClient ;
2727import org .apache .cloudstack .backup .backroll .model .BackrollBackupMetrics ;
2828import org .apache .cloudstack .backup .backroll .model .BackrollOffering ;
29+ import org .apache .cloudstack .backup .backroll .utils .BackrollHttpClient ;
30+ import org .apache .cloudstack .backup .backroll .utils .BackrollHttpClient .BackrollHttpClientException ;
2931import org .apache .cloudstack .backup .dao .BackupDao ;
3032import org .apache .cloudstack .framework .config .ConfigKey ;
3133import org .apache .logging .log4j .Logger ;
@@ -83,14 +85,14 @@ public void setUp() throws Exception {
8385 }
8486
8587 @ Test
86- public void listBackupOfferings_Test () throws BackrollApiException , IOException {
88+ public void listBackupOfferings_Test () throws BackrollHttpClientException , IOException {
8789 Mockito .doReturn (Arrays .asList (new BackrollOffering ("dummyName" , "dummyId" ))).when (clientMock ).getBackupOfferings ();
8890 List <BackupOffering > results = backupProvider .listBackupOfferings (2L );
8991 assertTrue (results .size () == 1 );
9092 }
9193
9294 @ Test
93- public void takeBackup_Test () throws BackrollApiException , IOException {
95+ public void takeBackup_Test () throws BackrollHttpClientException , IOException {
9496
9597 VMInstanceVO vmInstanceVO = new VMInstanceVO ();
9698 vmInstanceVO .setInstanceName ("test" );
@@ -129,7 +131,7 @@ public void getConfigComponentName_Test() {
129131 }
130132
131133 @ Test
132- public void restoreVMFromBackupTrue_Test () throws BackrollApiException , IOException {
134+ public void restoreVMFromBackupTrue_Test () throws BackrollHttpClientException , IOException {
133135 VMInstanceVO vmInstanceVO = new VMInstanceVO ();
134136 vmInstanceVO .setDataCenterId (2l );
135137
@@ -144,7 +146,7 @@ public void restoreVMFromBackupTrue_Test() throws BackrollApiException, IOExcept
144146 }
145147
146148 @ Test
147- public void restoreVMFromBackupFalse_Test () throws BackrollApiException , IOException {
149+ public void restoreVMFromBackupFalse_Test () throws BackrollHttpClientException , IOException {
148150 VMInstanceVO vmInstanceVO = new VMInstanceVO ();
149151 vmInstanceVO .setDataCenterId (2l );
150152
@@ -203,7 +205,7 @@ public void getClient_Test() {
203205 }
204206
205207 @ Test
206- public void deleteBackupTestSuccess_Test () throws BackrollApiException , IOException {
208+ public void deleteBackupTestSuccess_Test () throws BackrollHttpClientException , IOException {
207209 VMInstanceVO vmInstanceVO = new VMInstanceVO ();
208210 vmInstanceVO .setInstanceName ("test" );
209211 vmInstanceVO .setDataCenterId (2l );
@@ -236,7 +238,7 @@ public void deleteBackupBackinUp_Test() {
236238 }
237239
238240 @ Test
239- public void listRestorePoints_Test () throws BackrollApiException , IOException {
241+ public void listRestorePoints_Test () throws BackrollHttpClientException , IOException {
240242 List <RestorePoint > rps = Arrays .asList (new RestorePoint ("rp1" , new Date (), "incremental" ), new RestorePoint ("rp2" , new Date (), "incremental" ),
241243 new RestorePoint ("rp3" , new Date (), "incremental" ), new RestorePoint ("rp4" , new Date (), "incremental" ));
242244
@@ -254,7 +256,7 @@ public void listRestorePoints_Test() throws BackrollApiException, IOException {
254256 }
255257
256258 @ Test
257- public void createNewBackupEntryForRestorePoint_Test () throws BackrollApiException , IOException {
259+ public void createNewBackupEntryForRestorePoint_Test () throws BackrollHttpClientException , IOException {
258260 RestorePoint restorePoint = new RestorePoint ("restore-123" , new Date (), "INCREMENTAL" );
259261
260262 VMInstanceVO vm = new VMInstanceVO ();
@@ -293,7 +295,7 @@ public void createNewBackupEntryForRestorePoint_Test() throws BackrollApiExcepti
293295 }
294296
295297 @ Test
296- public void createNewBackupEntryForRestorePoint_WithMetric_Test () throws BackrollApiException , IOException {
298+ public void createNewBackupEntryForRestorePoint_WithMetric_Test () throws BackrollHttpClientException , IOException {
297299 RestorePoint restorePoint = new RestorePoint ("restore-789" , new Date (), "INCREMENTAL" );
298300
299301 VMInstanceVO vm = new VMInstanceVO ();
@@ -325,7 +327,7 @@ public void createNewBackupEntryForRestorePoint_WithMetric_Test() throws Backrol
325327 }
326328
327329 @ Test
328- public void createNewBackupEntryForRestorePoint_BackrollApiException_Test () throws BackrollApiException , IOException {
330+ public void createNewBackupEntryForRestorePoint_BackrollHttpClientException_Test () throws BackrollHttpClientException , IOException {
329331
330332 RestorePoint restorePoint = new RestorePoint ("restore-404" , new Date (), "INCREMENTAL" );
331333
@@ -336,13 +338,13 @@ public void createNewBackupEntryForRestorePoint_BackrollApiException_Test() thro
336338
337339 Backup .Metric metric = null ;
338340
339- Mockito .doThrow (new BackrollApiException ( )).when (clientMock ).getBackupMetrics (vm .getUuid (), restorePoint .getId ());
341+ Mockito .doThrow (new BackrollHttpClient . BackrollHttpClientException ( new Exception () )).when (clientMock ).getBackupMetrics (vm .getUuid (), restorePoint .getId ());
340342
341343 // backupProvider.createNewBackupEntryForRestorePoint(restorePoint, vm, metric);
342344 }
343345
344346 @ Test
345- public void createNewBackupEntryForRestorePoint_IOException_Test () throws BackrollApiException , IOException {
347+ public void createNewBackupEntryForRestorePoint_IOException_Test () throws BackrollHttpClientException , IOException {
346348
347349 RestorePoint restorePoint = new RestorePoint ("restore-500" , new Date (), "INCREMENTAL" );
348350
0 commit comments