Browse Source

Updates to use new boot 3 class in version verifier.

pull/1089/head
spencergibb 3 years ago
parent
commit
bed3e3de6e
No known key found for this signature in database
GPG Key ID: 7788A47380690861
  1. 18
      spring-cloud-commons/src/main/java/org/springframework/cloud/configuration/SpringBootVersionVerifier.java
  2. 16
      spring-cloud-commons/src/test/java/org/springframework/cloud/configuration/SpringBootDependencyTests.java

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

@ -80,14 +80,16 @@ class SpringBootVersionVerifier implements CompatibilityVerifier { @@ -80,14 +80,16 @@ class SpringBootVersionVerifier implements CompatibilityVerifier {
@Override
public boolean isCompatible() {
// try {
// since 3.0
// FIXME: find class or method in boot that is new in 3.0
// Class.forName("org.springframework.boot.autoconfigure.data.redis.ClientResourcesBuilderCustomizer");
return true;
/*
* } catch (ClassNotFoundException e) { return false; }
*/
try {
// since 3.0
Class.forName(
"org.springframework.boot.context.properties.ConfigurationPropertiesBindConstructorProvider");
return true;
}
catch (ClassNotFoundException e) {
return false;
}
}
};

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

@ -175,20 +175,8 @@ public class SpringBootDependencyTests { @@ -175,20 +175,8 @@ public class SpringBootDependencyTests {
@Test
public void should_match_against_current_manifest() {
try {
verifyCurrentVersionFromManifest("3.0");
verifyCurrentVersionFromManifest("3.0.x");
}
catch (AssertionError e) {
if (e.getMessage() != null && e.getMessage().contains("2.7.")) {
// we're likely running a boot 2.7 compatibility test, try 2.7
verifyCurrentVersionFromManifest("2.7");
verifyCurrentVersionFromManifest("2.7.x");
}
else {
throw e;
}
}
verifyCurrentVersionFromManifest("3.0");
verifyCurrentVersionFromManifest("3.0.x");
}
private void verifyCurrentVersionFromManifest(String version) {

Loading…
Cancel
Save