use of com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService.SdkStatus in project google-cloud-intellij by GoogleCloudPlatform.
the class ManagedCloudSdkServiceTest method failed_update_validSdk_sdkStatus_available.
@Test
public void failed_update_validSdk_sdkStatus_available() throws Exception {
makeMockSdkInstalled(MOCK_SDK_PATH);
emulateMockSdkUpdateProcess();
SdkUpdater mockUpdater = mockManagedCloudSdk.newUpdater();
doThrow(new CommandExitException(-1, "")).when(mockUpdater).update(any(), any());
sdkService.addStatusUpdateListener(mockStatusUpdateListener);
sdkService.update();
ArgumentCaptor<SdkStatus> statusCaptor = ArgumentCaptor.forClass(SdkStatus.class);
verify(mockStatusUpdateListener, times(2)).onSdkStatusChange(any(), statusCaptor.capture());
assertThat(statusCaptor.getAllValues()).isEqualTo(Arrays.asList(SdkStatus.INSTALLING, SdkStatus.READY));
}
Aggregations