|
@@ -42,6 +42,7 @@ class GeneratePomTest {
|
|
private static class Dependency {
|
|
private static class Dependency {
|
|
private String artifactId;
|
|
private String artifactId;
|
|
private String scope;
|
|
private String scope;
|
|
|
|
+ private String version;
|
|
private boolean optional;
|
|
private boolean optional;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -54,7 +55,7 @@ class GeneratePomTest {
|
|
Map<String, Dependency> dependenciesMap = new HashMap<>();
|
|
Map<String, Dependency> dependenciesMap = new HashMap<>();
|
|
dependencies.forEach($this -> {
|
|
dependencies.forEach($this -> {
|
|
String artifactId = $this.s("artifactId").text();
|
|
String artifactId = $this.s("artifactId").text();
|
|
- dependenciesMap.put(artifactId, new Dependency(artifactId, $this.s("scope").text(), Boolean.parseBoolean($this.s("optional").text())));
|
|
|
|
|
|
+ dependenciesMap.put(artifactId, new Dependency(artifactId, $this.s("scope").text(), $this.s("version").text(), Boolean.parseBoolean($this.s("optional").text())));
|
|
});
|
|
});
|
|
Dependency mp = dependenciesMap.get("mybatis-plus");
|
|
Dependency mp = dependenciesMap.get("mybatis-plus");
|
|
Assertions.assertEquals("compile", mp.getScope());
|
|
Assertions.assertEquals("compile", mp.getScope());
|
|
@@ -74,6 +75,9 @@ class GeneratePomTest {
|
|
Dependency bom = dependenciesMap.get("spring-boot-dependencies");
|
|
Dependency bom = dependenciesMap.get("spring-boot-dependencies");
|
|
Assertions.assertEquals("import", bom.getScope());
|
|
Assertions.assertEquals("import", bom.getScope());
|
|
Assertions.assertFalse(bom.isOptional());
|
|
Assertions.assertFalse(bom.isOptional());
|
|
|
|
+ Assertions.assertEquals(dependenciesMap.get("spring-cloud-commons").getVersion(), "3.1.1");
|
|
|
|
+ Assertions.assertEquals(dependenciesMap.get("mybatis-spring").getVersion(), "2.1.2");
|
|
|
|
+ Assertions.assertEquals(dependenciesMap.get("spring-boot-dependencies").getVersion(), "2.7.15");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|