Search in sources :

Example 16 with CloudProject

use of com.google.cloud.tools.intellij.project.CloudProject in project google-cloud-intellij by GoogleCloudPlatform.

the class SetupCloudRepositoryDialog method doOKAction.

@Override
protected void doOKAction() {
    CloudProject selectedProject = projectSelector.getSelectedProject();
    projectId = selectedProject.projectId();
    repositoryId = repositorySelector.getText();
    remoteName = remoteNameSelector.getText();
    credentialedUser = Services.getLoginService().getLoggedInUser(selectedProject.googleUsername()).orElse(null);
    super.doOKAction();
}
Also used : CloudProject(com.google.cloud.tools.intellij.project.CloudProject)

Example 17 with CloudProject

use of com.google.cloud.tools.intellij.project.CloudProject in project google-cloud-intellij by GoogleCloudPlatform.

the class AppEngineFlexibleDeploymentEditorTest method applyEditorTo_doesSetCloudProjectName.

@Test
public void applyEditorTo_doesSetCloudProjectName() {
    CloudProject project = CloudProject.create("some-project", "some-project", EMAIL);
    when(projectSelector.getSelectedProject()).thenReturn(project);
    editor.applyEditorTo(configuration);
    assertThat(configuration.getCloudProjectName()).isEqualTo(project.projectId());
}
Also used : CloudProject(com.google.cloud.tools.intellij.project.CloudProject) Test(org.junit.Test)

Example 18 with CloudProject

use of com.google.cloud.tools.intellij.project.CloudProject in project google-cloud-intellij by GoogleCloudPlatform.

the class AppEngineFlexibleDeploymentEditorTest method resetEditorFrom_withCloudProjectName_doesSetCloudProjectName.

@Test
public void resetEditorFrom_withCloudProjectName_doesSetCloudProjectName() {
    String projectName = "some-project";
    configuration.setCloudProjectName(projectName);
    configuration.setGoogleUsername(EMAIL);
    editor.resetEditorFrom(configuration);
    CloudProject expectedProject = CloudProject.create(projectName, projectName, EMAIL);
    verify(projectSelector).setSelectedProject(expectedProject);
}
Also used : CloudProject(com.google.cloud.tools.intellij.project.CloudProject) Test(org.junit.Test)

Example 19 with CloudProject

use of com.google.cloud.tools.intellij.project.CloudProject in project google-cloud-intellij by GoogleCloudPlatform.

the class AppEngineStandardDeploymentEditorTest method applyEditorTo_withUser_doesSetGoogleUsername.

@Test
public void applyEditorTo_withUser_doesSetGoogleUsername() throws Exception {
    when(credentialedUser.getEmail()).thenReturn(EMAIL);
    String projectId = "some-project";
    CloudProject project = CloudProject.create(projectId, projectId, EMAIL);
    when(projectSelector.getSelectedProject()).thenReturn(project);
    editor.applyEditorTo(configuration);
    assertThat(configuration.getGoogleUsername()).isEqualTo(EMAIL);
}
Also used : CloudProject(com.google.cloud.tools.intellij.project.CloudProject) Test(org.junit.Test)

Example 20 with CloudProject

use of com.google.cloud.tools.intellij.project.CloudProject in project google-cloud-intellij by GoogleCloudPlatform.

the class AppEngineStandardDeploymentEditorTest method applyEditorTo_doesSetCloudProjectName.

@Test
public void applyEditorTo_doesSetCloudProjectName() throws Exception {
    String projectId = "some-project";
    CloudProject project = CloudProject.create(projectId, projectId, EMAIL);
    when(projectSelector.getSelectedProject()).thenReturn(project);
    editor.applyEditorTo(configuration);
    assertThat(configuration.getCloudProjectName()).isEqualTo(projectId);
}
Also used : CloudProject(com.google.cloud.tools.intellij.project.CloudProject) Test(org.junit.Test)

Aggregations

CloudProject (com.google.cloud.tools.intellij.project.CloudProject)20 Test (org.junit.Test)10 CredentialedUser (com.google.cloud.tools.intellij.login.CredentialedUser)5 CloudLibrary (com.google.cloud.tools.libraries.json.CloudLibrary)3 Role (com.google.api.services.iam.v1.model.Role)2 Nullable (org.jetbrains.annotations.Nullable)2 Base64 (com.google.api.client.util.Base64)1 CloudResourceManager (com.google.api.services.cloudresourcemanager.CloudResourceManager)1 Binding (com.google.api.services.cloudresourcemanager.model.Binding)1 GetIamPolicyRequest (com.google.api.services.cloudresourcemanager.model.GetIamPolicyRequest)1 Policy (com.google.api.services.cloudresourcemanager.model.Policy)1 SetIamPolicyRequest (com.google.api.services.cloudresourcemanager.model.SetIamPolicyRequest)1 Iam (com.google.api.services.iam.v1.Iam)1 CreateServiceAccountKeyRequest (com.google.api.services.iam.v1.model.CreateServiceAccountKeyRequest)1 CreateServiceAccountRequest (com.google.api.services.iam.v1.model.CreateServiceAccountRequest)1 ServiceAccount (com.google.api.services.iam.v1.model.ServiceAccount)1 ServiceAccountKey (com.google.api.services.iam.v1.model.ServiceAccountKey)1 ServiceManagement (com.google.api.services.servicemanagement.ServiceManagement)1 EnableServiceRequest (com.google.api.services.servicemanagement.model.EnableServiceRequest)1 GoogleCloudCoreIcons (com.google.cloud.tools.intellij.GoogleCloudCoreIcons)1