@Test public void interruptedInstall_showsCancelNotification() throws Exception { emulateMockSdkInstallationProcess(MOCK_SDK_PATH); SdkInstaller sdkInstaller = mockManagedCloudSdk.newInstaller(); when(sdkInstaller.install(any(), any())).thenThrow(new InterruptedException()); when(mockManagedCloudSdk.newInstaller()).thenReturn(sdkInstaller); sdkService.install(); verify(mockUiPresenter).notifyManagedSdkJobCancellation(ManagedSdkJobType.INSTALL); }
@Test public void cancelledInstall_showsCancelNotification() throws Exception { emulateMockSdkInstallationProcess(MOCK_SDK_PATH); SdkInstaller sdkInstaller = mockManagedCloudSdk.newInstaller(); when(sdkInstaller.install(any(), any())).thenThrow(new CancellationException()); when(mockManagedCloudSdk.newInstaller()).thenReturn(sdkInstaller); sdkService.install(); verify(mockUiPresenter).notifyManagedSdkJobCancellation(ManagedSdkJobType.INSTALL); }
@Test public void cancelled_update_showsNotification() throws Exception { makeMockSdkInstalled(MOCK_SDK_PATH); emulateMockSdkUpdateProcess(); SdkUpdater mockUpdater = mockManagedCloudSdk.newUpdater(); doThrow(new CancellationException()).when(mockUpdater).update(any(), any()); sdkService.update(); verify(mockUiPresenter).notifyManagedSdkJobCancellation(ManagedSdkJobType.UPDATE); }
CloudSdkServiceUserSettings.getInstance().setUserCancelledInstallation(true); ManagedCloudSdkServiceUiPresenter.getInstance().notifyManagedSdkJobCancellation(jobType); } else { logger.warn("Error while installing/updating managed Cloud SDK", throwable);