Search in sources :

Example 1 with CancellableRunnable

use of com.intellij.openapi.vcs.impl.CancellableRunnable in project google-cloud-intellij by GoogleCloudPlatform.

the class CloudSdkAppEngineHelperTest method testCreateFlexDeployRunner_noPersistedModule.

@Test
public void testCreateFlexDeployRunner_noPersistedModule() {
    when(deploymentConfiguration.getModuleName()).thenReturn(null);
    DeploymentSource flexSource = createMockDeployableDeploymentSource();
    when(((AppEngineDeployable) flexSource).getEnvironment()).thenReturn(AppEngineEnvironment.APP_ENGINE_FLEX);
    File mockSourceFile = mock(File.class);
    when(mockSourceFile.exists()).thenReturn(true);
    when(flexSource.getFile()).thenReturn(mockSourceFile);
    Optional<CancellableRunnable> runner = helper.createDeployRunner(loggingHandler, flexSource, deploymentConfiguration, callback);
    assertFalse(runner.isPresent());
    verify(callback, times(1)).errorOccurred("No app.yaml specified for flexible deployment.");
}
Also used : CancellableRunnable(com.intellij.openapi.vcs.impl.CancellableRunnable) DeploymentSource(com.intellij.remoteServer.configuration.deployment.DeploymentSource) File(java.io.File) Test(org.junit.Test)

Aggregations

CancellableRunnable (com.intellij.openapi.vcs.impl.CancellableRunnable)1 DeploymentSource (com.intellij.remoteServer.configuration.deployment.DeploymentSource)1 File (java.io.File)1 Test (org.junit.Test)1