mirror of
https://gitee.com/dcren/initializr.git
synced 2025-11-28 09:22:41 +08:00
Add dependency range info
This commit improves the `info` endpoint to contain a `dependency-ranges` entry that is similar than the `bom-ranges` entry for BOMs. Each dependency that has a version mapping is listed with the range and the related version. Some dependencies weren't managed and are now. For those a `managed` version is used to indicate which Spring Boot versions do not require to specify a version for the dependency. Closes gh-453
This commit is contained in:
@@ -55,6 +55,10 @@ public class VersionRange {
|
||||
this.higherInclusive = higherInclusive;
|
||||
}
|
||||
|
||||
public VersionRange(Version startingVersion) {
|
||||
this(startingVersion, true, null, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify if the {@link Version} matches this range. Returns {@code true}
|
||||
* if the version is contained within this range, {@code false} otherwise.
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.core.IsNot.not;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
@@ -36,6 +37,12 @@ public class VersionRangeTests {
|
||||
@Rule
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Test
|
||||
public void simpleStartingRange() {
|
||||
assertThat(new VersionRange(Version.parse("1.3.0.RELEASE")).toString(),
|
||||
equalTo(">=1.3.0.RELEASE"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void matchSimpleRange() {
|
||||
assertThat("1.2.0.RC3", match("[1.2.0.RC1,1.2.0.RC5]"));
|
||||
|
||||
Reference in New Issue
Block a user