use of com.google.api.services.cloudresourcemanager.model.Project in project google-cloud-intellij by GoogleCloudPlatform.
the class ProjectLoaderTest method loadUserProjects_sortsProjects_byName.
@Test
public void loadUserProjects_sortsProjects_byName() {
Project aProject = new Project();
aProject.setName("a project");
aProject.setProjectId("The ID");
mockListProjectsResponse(Arrays.asList(testProject1, testProject2, aProject));
projectLoader.loadUserProjectsInBackground(mockUser);
verify(mockFutureCallback).onSuccess(Arrays.asList(aProject, testProject1, testProject2));
}
use of com.google.api.services.cloudresourcemanager.model.Project in project google-cloud-intellij by GoogleCloudPlatform.
the class ProjectLoaderTest method setUp.
@Before
public void setUp() {
when(mockGoogleApiClientFactory.getCloudResourceManagerClient(any())).thenReturn(mockCloudResourceManager);
when(projectLoader.loadUserProjectsInBackground(any())).then((Answer<ListenableFuture<List<Project>>>) invocation -> {
@SuppressWarnings("unchecked") ListenableFuture<List<Project>> result = (ListenableFuture<List<Project>>) invocation.callRealMethod();
Futures.addCallback(result, mockFutureCallback);
return result;
});
testProject1 = new Project();
testProject1.setName("test-project");
testProject1.setProjectId("test-project-ID");
testProject2 = new Project();
testProject2.setName("test-project-2");
testProject2.setProjectId("test-project-2-ID");
}
Aggregations