Search in sources :

Example 6 with SdkUpdater

use of com.google.cloud.tools.managedcloudsdk.components.SdkUpdater in project google-cloud-intellij by GoogleCloudPlatform.

the class ManagedCloudSdkServiceTest method emulateMockSdkUpdateProcess.

/**
 * Mocks out-of-date SDK and update process.
 */
private void emulateMockSdkUpdateProcess() {
    try {
        when(mockManagedCloudSdk.isUpToDate()).thenReturn(false);
        SdkUpdater mockUpdater = mock(SdkUpdater.class);
        when(mockManagedCloudSdk.newUpdater()).thenReturn(mockUpdater);
    } catch (Exception ex) {
        // shouldn't happen in the tests.
        throw new AssertionError(ex);
    }
}
Also used : SdkUpdater(com.google.cloud.tools.managedcloudsdk.components.SdkUpdater) ManagedSdkVerificationException(com.google.cloud.tools.managedcloudsdk.ManagedSdkVerificationException) UnsupportedOsException(com.google.cloud.tools.managedcloudsdk.UnsupportedOsException) CommandExitException(com.google.cloud.tools.managedcloudsdk.command.CommandExitException) CommandExecutionException(com.google.cloud.tools.managedcloudsdk.command.CommandExecutionException) CancellationException(java.util.concurrent.CancellationException) IOException(java.io.IOException)

Aggregations

SdkUpdater (com.google.cloud.tools.managedcloudsdk.components.SdkUpdater)6 Test (org.junit.Test)5 SdkStatus (com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService.SdkStatus)4 CommandExitException (com.google.cloud.tools.managedcloudsdk.command.CommandExitException)3 CancellationException (java.util.concurrent.CancellationException)3 ManagedSdkVerificationException (com.google.cloud.tools.managedcloudsdk.ManagedSdkVerificationException)1 UnsupportedOsException (com.google.cloud.tools.managedcloudsdk.UnsupportedOsException)1 CommandExecutionException (com.google.cloud.tools.managedcloudsdk.command.CommandExecutionException)1 IOException (java.io.IOException)1