Skip to content

Commit 20e71c5

Browse files
committed
Adds support for Spring Boot 3.3
Fixes gh-1343
1 parent 5b5bf58 commit 20e71c5

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

spring-cloud-commons/src/main/java/org/springframework/cloud/configuration/CompatibilityVerifierProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class CompatibilityVerifierProperties {
3636
* the patch version if you don't want to specify a concrete value. Example:
3737
* {@code 3.4.x}
3838
*/
39-
private List<String> compatibleBootVersions = List.of("3.2.x");
39+
private List<String> compatibleBootVersions = List.of("3.2.x", "3.3.x");
4040

4141
public boolean isEnabled() {
4242
return this.enabled;

spring-cloud-commons/src/main/java/org/springframework/cloud/configuration/SpringBootVersionVerifier.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.apache.commons.logging.LogFactory;
2525

2626
import org.springframework.boot.SpringBootVersion;
27-
import org.springframework.boot.autoconfigure.validation.ValidationConfigurationCustomizer;
2827
import org.springframework.util.StringUtils;
2928

3029
/**
@@ -37,6 +36,7 @@ class SpringBootVersionVerifier implements CompatibilityVerifier {
3736
final Map<String, CompatibilityPredicate> ACCEPTED_VERSIONS = new HashMap<>() {
3837
{
3938
this.put("3.2", is3_2());
39+
this.put("3.3", is3_3());
4040
}
4141
};
4242

@@ -88,31 +88,27 @@ public boolean isCompatible() {
8888
catch (ClassNotFoundException e) {
8989
return false;
9090
}
91-
9291
}
9392
};
9493
}
9594

96-
CompatibilityPredicate is3_1() {
95+
CompatibilityPredicate is3_3() {
9796
return new CompatibilityPredicate() {
9897

9998
@Override
10099
public String toString() {
101-
return "Predicate for Boot 3.1";
100+
return "Predicate for Boot 3.3";
102101
}
103102

104103
@Override
105104
public boolean isCompatible() {
106105
try {
107-
// since 3.1
108-
ValidationConfigurationCustomizer.class.getMethod("setIgnoreRegistrationFailure", boolean.class);
106+
Class.forName("org.springframework.boot.autoconfigure.ldap.PropertiesLdapConnectionDetails");
109107
return true;
110-
111108
}
112-
catch (NoSuchMethodException e) {
109+
catch (ClassNotFoundException e) {
113110
return false;
114111
}
115-
116112
}
117113
};
118114
}

spring-cloud-commons/src/test/java/org/springframework/cloud/configuration/SpringBootDependencyTests.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,14 @@ public void should_match_against_current_manifest() {
180180
verifyCurrentVersionFromManifest("3.2.x");
181181
}
182182
catch (AssertionError e) {
183-
// if (e.getMessage() != null && e.getMessage().contains("3.3.")) {
184-
// we're likely running a boot 3.3 compatibility test, try 3.3
185-
// verifyCurrentVersionFromManifest("3.3");
186-
// verifyCurrentVersionFromManifest("3.3.x");
187-
// }
188-
// else {
189-
throw e;
190-
// }
183+
if (e.getMessage() != null && e.getMessage().contains("3.3.")) {
184+
// we're likely running a boot 3.3 compatibility test, try 3.3
185+
verifyCurrentVersionFromManifest("3.3");
186+
verifyCurrentVersionFromManifest("3.3.x");
187+
}
188+
else {
189+
throw e;
190+
}
191191
}
192192
}
193193

0 commit comments

Comments
 (0)