增加版本号检查.
This commit is contained in:
parent
beed4977c7
commit
473d40e8b6
@ -42,6 +42,7 @@ class GeneratePomTest {
|
||||
private static class Dependency {
|
||||
private String artifactId;
|
||||
private String scope;
|
||||
private String version;
|
||||
private boolean optional;
|
||||
}
|
||||
|
||||
@ -54,7 +55,7 @@ class GeneratePomTest {
|
||||
Map<String, Dependency> dependenciesMap = new HashMap<>();
|
||||
dependencies.forEach($this -> {
|
||||
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");
|
||||
Assertions.assertEquals("compile", mp.getScope());
|
||||
@ -74,6 +75,9 @@ class GeneratePomTest {
|
||||
Dependency bom = dependenciesMap.get("spring-boot-dependencies");
|
||||
Assertions.assertEquals("import", bom.getScope());
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,6 +42,7 @@ class GeneratePomTest {
|
||||
private static class Dependency {
|
||||
private String artifactId;
|
||||
private String scope;
|
||||
private String version;
|
||||
private boolean optional;
|
||||
}
|
||||
|
||||
@ -54,7 +55,7 @@ class GeneratePomTest {
|
||||
Map<String, Dependency> dependenciesMap = new HashMap<>();
|
||||
dependencies.forEach($this -> {
|
||||
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");
|
||||
Assertions.assertEquals("compile", mp.getScope());
|
||||
@ -74,6 +75,9 @@ class GeneratePomTest {
|
||||
Dependency bom = dependenciesMap.get("spring-boot-dependencies");
|
||||
Assertions.assertEquals("import", bom.getScope());
|
||||
Assertions.assertFalse(bom.isOptional());
|
||||
Assertions.assertEquals(dependenciesMap.get("spring-cloud-commons").getVersion(), "4.0.4");
|
||||
Assertions.assertEquals(dependenciesMap.get("mybatis-spring").getVersion(), "3.0.3");
|
||||
Assertions.assertEquals(dependenciesMap.get("spring-boot-dependencies").getVersion(), "3.2.0");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user