use of com.google.cloud.tools.intellij.testing.apis.TestCloudLibrary.TestCloudLibraryClientMavenCoordinates in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudLibraryProjectStateTest method getCloudLibraries_withOnlyCloudDependencies_returnsValidCloudLibrary.
@Test
public void getCloudLibraries_withOnlyCloudDependencies_returnsValidCloudLibrary() {
when(librariesService.getCloudLibraries()).thenReturn(ImmutableList.of(LIBRARY.toCloudLibrary()));
ApplicationManager.getApplication().invokeAndWait(() -> {
try {
Module module = MavenTestUtils.getInstance().createNewMavenModule(moduleBuilder, testFixture.getProject());
TestCloudLibraryClientMavenCoordinates mavenCoordinates = LIBRARY.clients().get(0).mavenCoordinates();
String groupId = mavenCoordinates.groupId();
String artifactId = mavenCoordinates.artifactId();
MavenId managedDependency = new MavenId(groupId, artifactId, "1.0");
writeDependenciesToPom(module, ImmutableList.of(managedDependency));
state.syncManagedProjectLibraries();
Set<CloudLibrary> libraries = state.getCloudLibraries(module);
assertThat_cloudLibrariesContainsExactlyOne(libraries);
} finally {
MavenServerManager.getInstance().shutdown(true);
}
});
}
use of com.google.cloud.tools.intellij.testing.apis.TestCloudLibrary.TestCloudLibraryClientMavenCoordinates in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudLibraryProjectStateTest method getCloudLibraries_withCloudAndNonCloudDependencies_returnsValidCloudLibrary.
@Test
public void getCloudLibraries_withCloudAndNonCloudDependencies_returnsValidCloudLibrary() {
when(librariesService.getCloudLibraries()).thenReturn(ImmutableList.of(LIBRARY.toCloudLibrary()));
ApplicationManager.getApplication().invokeAndWait(() -> {
try {
Module module = MavenTestUtils.getInstance().createNewMavenModule(moduleBuilder, testFixture.getProject());
TestCloudLibraryClientMavenCoordinates mavenCoordinates = LIBRARY.clients().get(0).mavenCoordinates();
String groupId = mavenCoordinates.groupId();
String artifactId = mavenCoordinates.artifactId();
MavenId cloudDependency = new MavenId(groupId, artifactId, "1.0");
MavenId nonCloudDependency = new MavenId("my-group", "my-artifact", "1.0");
writeDependenciesToPom(module, ImmutableList.of(cloudDependency, nonCloudDependency));
state.syncManagedProjectLibraries();
Set<CloudLibrary> libraries = state.getCloudLibraries(module);
assertThat_cloudLibrariesContainsExactlyOne(libraries);
} finally {
MavenServerManager.getInstance().shutdown(true);
}
});
}
Aggregations