Adds support for boot 3.4

This commit is contained in:
spencergibb
2024-08-05 13:21:35 -04:00
parent 40808a31d5
commit bf7ddb17f5
3 changed files with 16 additions and 38 deletions

View File

@@ -36,7 +36,7 @@ public class CompatibilityVerifierProperties {
* the patch version if you don't want to specify a concrete value. Example:
* {@code 3.4.x}
*/
private List<String> compatibleBootVersions = List.of("3.2.x", "3.3.x");
private List<String> compatibleBootVersions = List.of("3.4.x");
public boolean isEnabled() {
return this.enabled;

View File

@@ -35,8 +35,7 @@ class SpringBootVersionVerifier implements CompatibilityVerifier {
final Map<String, CompatibilityPredicate> ACCEPTED_VERSIONS = new HashMap<>() {
{
this.put("3.2", is3_2());
this.put("3.3", is3_3());
this.put("3.4", is3_4());
}
};
@@ -71,12 +70,12 @@ class SpringBootVersionVerifier implements CompatibilityVerifier {
return SpringBootVersion.getVersion();
}
CompatibilityPredicate is3_2() {
CompatibilityPredicate is3_4() {
return new CompatibilityPredicate() {
@Override
public String toString() {
return "Predicate for Boot 3.2";
return "Predicate for Boot 3.4";
}
@Override
@@ -92,27 +91,6 @@ class SpringBootVersionVerifier implements CompatibilityVerifier {
};
}
CompatibilityPredicate is3_3() {
return new CompatibilityPredicate() {
@Override
public String toString() {
return "Predicate for Boot 3.3";
}
@Override
public boolean isCompatible() {
try {
Class.forName("org.springframework.boot.autoconfigure.ldap.PropertiesLdapConnectionDetails");
return true;
}
catch (ClassNotFoundException e) {
return false;
}
}
};
}
private String errorDescription() {
String versionFromManifest = getVersionFromManifest();
if (StringUtils.hasText(versionFromManifest)) {

View File

@@ -176,18 +176,18 @@ public class SpringBootDependencyTests {
@Test
public void should_match_against_current_manifest() {
try {
verifyCurrentVersionFromManifest("3.2");
verifyCurrentVersionFromManifest("3.2.x");
verifyCurrentVersionFromManifest("3.4");
verifyCurrentVersionFromManifest("3.4.x");
}
catch (AssertionError e) {
if (e.getMessage() != null && e.getMessage().contains("3.3.")) {
// we're likely running a boot 3.3 compatibility test, try 3.3
verifyCurrentVersionFromManifest("3.3");
verifyCurrentVersionFromManifest("3.3.x");
}
else {
throw e;
}
// if (e.getMessage() != null && e.getMessage().contains("3.3.")) {
// // we're likely running a boot 3.3 compatibility test, try 3.3
// verifyCurrentVersionFromManifest("3.3");
// verifyCurrentVersionFromManifest("3.3.x");
// }
// else {
throw e;
// }
}
}
@@ -212,7 +212,7 @@ public class SpringBootDependencyTests {
}
};
versionVerifier.ACCEPTED_VERSIONS.clear();
versionVerifier.ACCEPTED_VERSIONS.put("3.0", versionVerifier.is3_2());
versionVerifier.ACCEPTED_VERSIONS.put("3.0", versionVerifier.is3_4());
VerificationResult verificationResult = versionVerifier.verify();
@@ -230,7 +230,7 @@ public class SpringBootDependencyTests {
}
};
versionVerifier.ACCEPTED_VERSIONS.clear();
versionVerifier.ACCEPTED_VERSIONS.put("3.0", versionVerifier.is3_2());
versionVerifier.ACCEPTED_VERSIONS.put("3.0", versionVerifier.is3_4());
VerificationResult verificationResult = versionVerifier.verify();