Fixed invalid versions for compatibility verifier
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
||||
* Licensed under the Apache License, Version 2.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* http://www.apache.org/licenses/LICENSE-2.1
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||
@@ -25,12 +25,12 @@ public class SpringBootDependencyTests {
|
||||
|
||||
@Test
|
||||
public void should_read_concrete_version_from_manifest() {
|
||||
List<String> acceptedVersions = Collections.singletonList("2.0.3.RELEASE");
|
||||
List<String> acceptedVersions = Collections.singletonList("2.1.3.RELEASE");
|
||||
SpringBootVersionVerifier
|
||||
versionVerifier = new SpringBootVersionVerifier(acceptedVersions) {
|
||||
@Override
|
||||
String getVersionFromManifest() {
|
||||
return "2.0.3.RELEASE";
|
||||
return "2.1.3.RELEASE";
|
||||
}
|
||||
};
|
||||
versionVerifier.ACCEPTED_VERSIONS.clear();
|
||||
@@ -43,25 +43,7 @@ public class SpringBootDependencyTests {
|
||||
|
||||
@Test
|
||||
public void should_read_concrete_version_from_manifest_and_return_false_when_version_is_not_matched() {
|
||||
List<String> acceptedVersions = Collections.singletonList("2.0.9.RELEASE");
|
||||
SpringBootVersionVerifier
|
||||
versionVerifier = new SpringBootVersionVerifier(acceptedVersions) {
|
||||
@Override
|
||||
String getVersionFromManifest() {
|
||||
return "2.0.3.RELEASE";
|
||||
}
|
||||
};
|
||||
versionVerifier.ACCEPTED_VERSIONS.clear();
|
||||
|
||||
VerificationResult verificationResult = versionVerifier.verify();
|
||||
|
||||
BDDAssertions.then(verificationResult.description).isNotEmpty();
|
||||
BDDAssertions.then(verificationResult.action).isNotEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void should_read_concrete_version_from_manifest_and_return_false_when_minor_version_is_not_matched() {
|
||||
List<String> acceptedVersions = Collections.singletonList("2.0");
|
||||
List<String> acceptedVersions = Collections.singletonList("2.1.9.RELEASE");
|
||||
SpringBootVersionVerifier
|
||||
versionVerifier = new SpringBootVersionVerifier(acceptedVersions) {
|
||||
@Override
|
||||
@@ -78,13 +60,31 @@ public class SpringBootDependencyTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void should_read_concrete_version_from_manifest_and_match_it_against_minor_version() {
|
||||
List<String> acceptedVersions = Collections.singletonList("2.0");
|
||||
public void should_read_concrete_version_from_manifest_and_return_false_when_minor_version_is_not_matched() {
|
||||
List<String> acceptedVersions = Collections.singletonList("2.1");
|
||||
SpringBootVersionVerifier
|
||||
versionVerifier = new SpringBootVersionVerifier(acceptedVersions) {
|
||||
@Override
|
||||
String getVersionFromManifest() {
|
||||
return "2.0.3.RELEASE";
|
||||
return "2.99.3.RELEASE";
|
||||
}
|
||||
};
|
||||
versionVerifier.ACCEPTED_VERSIONS.clear();
|
||||
|
||||
VerificationResult verificationResult = versionVerifier.verify();
|
||||
|
||||
BDDAssertions.then(verificationResult.description).isNotEmpty();
|
||||
BDDAssertions.then(verificationResult.action).isNotEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void should_read_concrete_version_from_manifest_and_match_it_against_minor_version() {
|
||||
List<String> acceptedVersions = Collections.singletonList("2.1");
|
||||
SpringBootVersionVerifier
|
||||
versionVerifier = new SpringBootVersionVerifier(acceptedVersions) {
|
||||
@Override
|
||||
String getVersionFromManifest() {
|
||||
return "2.1.3.RELEASE";
|
||||
}
|
||||
};
|
||||
versionVerifier.ACCEPTED_VERSIONS.clear();
|
||||
@@ -139,7 +139,7 @@ public class SpringBootDependencyTests {
|
||||
|
||||
@Test
|
||||
public void should_match_against_current_manifest() {
|
||||
List<String> acceptedVersions = Collections.singletonList("2.0");
|
||||
List<String> acceptedVersions = Collections.singletonList("2.1");
|
||||
SpringBootVersionVerifier
|
||||
versionVerifier = new SpringBootVersionVerifier(acceptedVersions);
|
||||
versionVerifier.ACCEPTED_VERSIONS.clear();
|
||||
@@ -152,7 +152,7 @@ public class SpringBootDependencyTests {
|
||||
|
||||
@Test
|
||||
public void should_match_against_current_predicate() {
|
||||
List<String> acceptedVersions = Collections.singletonList("2.0");
|
||||
List<String> acceptedVersions = Collections.singletonList("2.1");
|
||||
SpringBootVersionVerifier
|
||||
versionVerifier = new SpringBootVersionVerifier(acceptedVersions){
|
||||
@Override
|
||||
@@ -161,7 +161,7 @@ public class SpringBootDependencyTests {
|
||||
}
|
||||
};
|
||||
versionVerifier.ACCEPTED_VERSIONS.clear();
|
||||
versionVerifier.ACCEPTED_VERSIONS.put("2.0", versionVerifier.is2_0());
|
||||
versionVerifier.ACCEPTED_VERSIONS.put("2.1", versionVerifier.is2_1());
|
||||
|
||||
VerificationResult verificationResult = versionVerifier.verify();
|
||||
|
||||
@@ -171,7 +171,7 @@ public class SpringBootDependencyTests {
|
||||
|
||||
@Test
|
||||
public void should_match_against_current_predicate_with_version_ending_with_x() {
|
||||
List<String> acceptedVersions = Collections.singletonList("2.0.x");
|
||||
List<String> acceptedVersions = Collections.singletonList("2.1.x");
|
||||
SpringBootVersionVerifier
|
||||
versionVerifier = new SpringBootVersionVerifier(acceptedVersions){
|
||||
@Override
|
||||
@@ -180,7 +180,7 @@ public class SpringBootDependencyTests {
|
||||
}
|
||||
};
|
||||
versionVerifier.ACCEPTED_VERSIONS.clear();
|
||||
versionVerifier.ACCEPTED_VERSIONS.put("2.0", versionVerifier.is2_0());
|
||||
versionVerifier.ACCEPTED_VERSIONS.put("2.1", versionVerifier.is2_1());
|
||||
|
||||
VerificationResult verificationResult = versionVerifier.verify();
|
||||
|
||||
@@ -190,7 +190,7 @@ public class SpringBootDependencyTests {
|
||||
|
||||
@Test
|
||||
public void should_fail_to_match_against_predicate_for_non_current_versions() {
|
||||
List<String> acceptedVersions = Collections.singletonList("2.0");
|
||||
List<String> acceptedVersions = Collections.singletonList("2.1");
|
||||
SpringBootVersionVerifier
|
||||
versionVerifier = new SpringBootVersionVerifier(acceptedVersions) {
|
||||
@Override
|
||||
@@ -198,7 +198,7 @@ public class SpringBootDependencyTests {
|
||||
return "";
|
||||
}
|
||||
};
|
||||
versionVerifier.ACCEPTED_VERSIONS.remove("2.0");
|
||||
versionVerifier.ACCEPTED_VERSIONS.remove("2.1");
|
||||
|
||||
VerificationResult verificationResult = versionVerifier.verify();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user