use of com.google.cloud.tools.opensource.dependencies.Artifacts in project cloud-opensource-java by GoogleCloudPlatform.
the class LinkageMonitorTest method testBuildModelWithSnapshotBom_BomSnapshotUpdate.
@Test
public void testBuildModelWithSnapshotBom_BomSnapshotUpdate() throws ModelBuildingException, ArtifactResolutionException {
// Linkage Monitor should update a BOM in Google Cloud Libraries BOM when it's available local
// repository. This test case simulates the issue below where
// google-cloud-bom:0.106.0-alpha-SNAPSHOT should provide gax:1.48.0.
// https://github.com/GoogleCloudPlatform/cloud-opensource-java/issues/853
// Libraries-bom:2.2.1 has google-cloud-bom:0.91.0-alpha, which has gax:1.44.0
Model model = LinkageMonitor.buildModelWithSnapshotBom(system, session, "com.google.cloud:libraries-bom:2.2.1", ImmutableMap.of("com.google.cloud:google-cloud-bom", "0.106.0-alpha"));
List<Dependency> dependencies = model.getDependencyManagement().getDependencies();
// google-cloud-bom:0.106.0 has new artifacts such as google-cloud-gameservices
assertEquals(224, dependencies.size());
// google-cloud-bom:0.106.0-alpha has gax:1.48.0
assertTrue(dependencies.stream().anyMatch(dependency -> "gax".equals(dependency.getArtifactId()) && "1.48.0".equals(dependency.getVersion())));
}
Aggregations