mirror of
https://gitee.com/dcren/initializr.git
synced 2025-09-19 18:22:26 +08:00
Rename versionRange attribute to compatibilityRange
See gh-968
This commit is contained in:

committed by
Stephane Nicoll

parent
aaf44d1ec8
commit
71364408fa
@@ -55,8 +55,8 @@ public class InitializrMetadataV21JsonMapper extends InitializrMetadataV2JsonMap
|
||||
@Override
|
||||
protected ObjectNode mapDependency(Dependency dependency) {
|
||||
ObjectNode content = mapValue(dependency);
|
||||
if (dependency.getVersionRange() != null) {
|
||||
content.put("versionRange", dependency.getVersionRange());
|
||||
if (dependency.getCompatibilityRange() != null) {
|
||||
content.put("versionRange", dependency.getCompatibilityRange());
|
||||
}
|
||||
if (dependency.getLinks() != null && !dependency.getLinks().isEmpty()) {
|
||||
content.set("_links", LinkMapper.mapLinks(dependency.getLinks()));
|
||||
|
@@ -173,8 +173,8 @@ public class InitializrMetadataV2JsonMapper implements InitializrMetadataJsonMap
|
||||
}
|
||||
|
||||
protected ObjectNode mapDependency(Dependency dependency) {
|
||||
if (dependency.getVersionRange() == null) {
|
||||
// only map the dependency if no versionRange is set
|
||||
if (dependency.getCompatibilityRange() == null) {
|
||||
// only map the dependency if no compatibilityRange is set
|
||||
return mapValue(dependency);
|
||||
}
|
||||
return null;
|
||||
|
@@ -159,13 +159,13 @@ class CommandLineHelpGeneratorTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void generateCapabilitiesWithVersionRange() throws IOException {
|
||||
void generateCapabilitiesWithCompatibilityRange() throws IOException {
|
||||
Dependency first = Dependency.withId("first");
|
||||
first.setDescription("first desc");
|
||||
first.setVersionRange("1.2.0.RELEASE");
|
||||
first.setCompatibilityRange("1.2.0.RELEASE");
|
||||
Dependency second = Dependency.withId("second");
|
||||
second.setDescription("second desc");
|
||||
second.setVersionRange(" [1.2.0.RELEASE,1.3.0.M1) ");
|
||||
second.setCompatibilityRange(" [1.2.0.RELEASE,1.3.0.M1) ");
|
||||
InitializrMetadata metadata = InitializrMetadataTestBuilder.withDefaults()
|
||||
.addDependencyGroup("test", first, second).build();
|
||||
String content = this.generator.generateSpringBootCliCapabilities(metadata, "https://fake-service");
|
||||
|
@@ -37,10 +37,10 @@ class DefaultDependencyMetadataProviderTests {
|
||||
@Test
|
||||
void filterDependencies() {
|
||||
Dependency first = Dependency.withId("first", "org.foo", "first");
|
||||
first.setVersionRange("2.1.4.RELEASE");
|
||||
first.setCompatibilityRange("2.1.4.RELEASE");
|
||||
Dependency second = Dependency.withId("second", "org.foo", "second");
|
||||
Dependency third = Dependency.withId("third", "org.foo", "third");
|
||||
third.setVersionRange("2.1.8.RELEASE");
|
||||
third.setCompatibilityRange("2.1.8.RELEASE");
|
||||
InitializrMetadata metadata = InitializrMetadataTestBuilder.withDefaults()
|
||||
.addDependencyGroup("test", first, second, third).build();
|
||||
DependencyMetadata dependencyMetadata = this.provider.get(metadata, Version.parse("2.1.5.RELEASE"));
|
||||
|
@@ -40,11 +40,11 @@
|
||||
"defaultVersion": "1.2",
|
||||
"mappings": [
|
||||
{
|
||||
"versionRange": "[1.5.0.RELEASE,2.0.0.M1)",
|
||||
"compatibilityRange": "[1.5.0.RELEASE,2.0.0.M1)",
|
||||
"version": "1.0"
|
||||
},
|
||||
{
|
||||
"versionRange": "[2.0.0.M1,2.1.0.M1)",
|
||||
"compatibilityRange": "[2.0.0.M1,2.1.0.M1)",
|
||||
"version": "1.1"
|
||||
}
|
||||
]
|
||||
@@ -102,14 +102,14 @@
|
||||
],
|
||||
"mappings": [
|
||||
{
|
||||
"versionRange": "[2.0.0.RELEASE,2.1.6.RELEASE)",
|
||||
"compatibilityRange": "[2.0.0.RELEASE,2.1.6.RELEASE)",
|
||||
"repositories": [
|
||||
"my-api-repo-1"
|
||||
],
|
||||
"version": "1.0.0.RELEASE"
|
||||
},
|
||||
{
|
||||
"versionRange": "2.2.1.RELEASE",
|
||||
"compatibilityRange": "2.2.1.RELEASE",
|
||||
"repositories": [
|
||||
"my-api-repo-2"
|
||||
],
|
||||
@@ -219,7 +219,7 @@
|
||||
"name": "Biz",
|
||||
"scope": "runtime",
|
||||
"version": "1.3.5",
|
||||
"versionRange": "2.2.0.BUILD-SNAPSHOT"
|
||||
"compatibilityRange": "2.2.0.BUILD-SNAPSHOT"
|
||||
},
|
||||
{
|
||||
"starter": true,
|
||||
@@ -229,7 +229,7 @@
|
||||
"name": "Bur",
|
||||
"scope": "test",
|
||||
"version": "2.1.0",
|
||||
"versionRange": "[2.1.4.RELEASE,2.2.0.BUILD-SNAPSHOT)"
|
||||
"compatibilityRange": "[2.1.4.RELEASE,2.2.0.BUILD-SNAPSHOT)"
|
||||
},
|
||||
{
|
||||
"starter": true,
|
||||
|
Reference in New Issue
Block a user