Skip to content

Commit

Permalink
Adds support for boot 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
spencergibb committed Aug 5, 2024
1 parent 40808a3 commit bf7ddb1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
};

Expand Down Expand Up @@ -71,12 +70,12 @@ String getVersionFromManifest() {
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
Expand All @@ -92,27 +91,6 @@ public boolean isCompatible() {
};
}

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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,18 +176,18 @@ String getVersionFromManifest() {
@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;
// }
}
}

Expand All @@ -212,7 +212,7 @@ String getVersionFromManifest() {
}
};
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();

Expand All @@ -230,7 +230,7 @@ String getVersionFromManifest() {
}
};
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();

Expand Down

0 comments on commit bf7ddb1

Please sign in to comment.