Skip to content

Commit 0ad7863

Browse files
committed
Update compatibility
1 parent 808de61 commit 0ad7863

File tree

3 files changed

+16
-25
lines changed

3 files changed

+16
-25
lines changed

sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/compatibility/AzureSpringBootVersionVerifier.java

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,10 @@
1818
public class AzureSpringBootVersionVerifier {
1919
private static final Logger LOGGER = LoggerFactory.getLogger(AzureSpringBootVersionVerifier.class);
2020

21-
static final String SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_0 = "org.springframework.boot.autoconfigure.validation.ValidationConfigurationCustomizer";
22-
static final String SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_1 = "org.springframework.boot.autoconfigure.validation.ValidationConfigurationCustomizer.ValidationConfigurationCustomizer,setIgnoreRegistrationFailure,";
23-
static final String SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_2 = "org.springframework.boot.autoconfigure.web.client.RestClientSsl";
24-
static final String SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_3 = "org.springframework.boot.autoconfigure.ldap.PropertiesLdapConnectionDetails";
25-
static final String SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_4 = "org.springframework.boot.autoconfigure.http.client.HttpClientProperties";
26-
static final String SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_5 = "org.springframework.boot.autoconfigure.http.codec.HttpCodecsProperties";
21+
static final String SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_4_0 = "org.springframework.boot.autoconfigure.preinitialize.BackgroundPreinitializer";
22+
2723
/**
28-
* Versions supported by Spring Cloud Azure, for present is [3.0, 3.1, 3.2, 3.3, 3.4, 3.5]. Update this value if needed.
24+
* Versions supported by Spring Cloud Azure, for present is [4.0]. Update this value if needed.
2925
*/
3026
private final Map<String, String> supportedVersions = new HashMap<>();
3127

@@ -47,12 +43,7 @@ public AzureSpringBootVersionVerifier(List<String> acceptedVersions, ClassNameRe
4743
* Init default supported Spring Boot Version compatibility check meta data.
4844
*/
4945
private void initDefaultSupportedBootVersionCheckMeta() {
50-
supportedVersions.put("3.0", SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_0);
51-
supportedVersions.put("3.1", SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_1);
52-
supportedVersions.put("3.2", SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_2);
53-
supportedVersions.put("3.3", SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_3);
54-
supportedVersions.put("3.4", SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_4);
55-
supportedVersions.put("3.5", SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_5);
46+
supportedVersions.put("4.0", SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_4_0);
5647
}
5748

5849
/**

sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/compatibility/properties/AzureCompatibilityVerifierProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class AzureCompatibilityVerifierProperties {
1818
/**
1919
* Comma-delimited list of Spring Boot versions that are compatible with current Spring Cloud Azure's version.
2020
*/
21-
private List<String> compatibleBootVersions = Arrays.asList("3.0.x", "3.1.x", "3.2.x", "3.3.x", "3.4.x", "3.5.x");
21+
private List<String> compatibleBootVersions = Arrays.asList("4.0.x");
2222

2323
public boolean isEnabled() {
2424
return this.enabled;

sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/compatibility/AzureSpringBootVersionVerifierTest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import java.util.Collections;
1616
import java.util.List;
1717

18-
import static com.azure.spring.cloud.autoconfigure.implementation.compatibility.AzureSpringBootVersionVerifier.SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_0;
18+
import static com.azure.spring.cloud.autoconfigure.implementation.compatibility.AzureSpringBootVersionVerifier.SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_4_0;
1919
import static org.junit.jupiter.api.Assertions.assertEquals;
2020
import static org.junit.jupiter.api.Assertions.assertThrows;
2121
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -60,11 +60,11 @@ String getVersionFromManifest() {
6060

6161

6262
@ParameterizedTest
63-
@ValueSource(strings = { "3.0", "3.0.x" })
63+
@ValueSource(strings = { "4.0", "4.0.x" })
6464
void shouldMatchWhenManifestNumberNotPresentAndAcceptedNumberSpecifiedCase1(String acceptedVersion) {
6565
List<String> acceptedVersions = Collections.singletonList(acceptedVersion);
6666
ClassNameResolverPredicate mockResolver = mock(ClassNameResolverPredicate.class);
67-
when(mockResolver.resolve(SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_0)).thenReturn(true);
67+
when(mockResolver.resolve(SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_4_0)).thenReturn(true);
6868

6969
AzureSpringBootVersionVerifier versionVerifier = new AzureSpringBootVersionVerifier(acceptedVersions,
7070
mockResolver) {
@@ -81,11 +81,11 @@ String getVersionFromManifest() {
8181

8282

8383
@ParameterizedTest
84-
@ValueSource(strings = { "3.1", "3.1.x" })
84+
@ValueSource(strings = { "4.1", "4.1.x" })
8585
void shouldNotMatchWhenManifestNumberNotPresentAndAcceptedNumberSpecifiedCase1(String acceptedVersion) {
8686
List<String> acceptedVersions = Collections.singletonList(acceptedVersion);
8787
ClassNameResolverPredicate mockResolver = mock(ClassNameResolverPredicate.class);
88-
when(mockResolver.resolve(SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_0)).thenReturn(true);
88+
when(mockResolver.resolve(SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_4_0)).thenReturn(true);
8989

9090
AzureSpringBootVersionVerifier versionVerifier = new AzureSpringBootVersionVerifier(acceptedVersions,
9191
mockResolver) {
@@ -98,11 +98,11 @@ String getVersionFromManifest() {
9898
}
9999

100100
@ParameterizedTest
101-
@ValueSource(strings = { "3.0.0-M3" })
101+
@ValueSource(strings = { "4.0.0-M3" })
102102
void shouldNotMatchWhenManifestNumberNotPresentAndAcceptedNumberSpecifiedCase2(String acceptedVersion) {
103103
List<String> acceptedVersions = Collections.singletonList(acceptedVersion);
104104
ClassNameResolverPredicate mockResolver = mock(ClassNameResolverPredicate.class);
105-
when(mockResolver.resolve(SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_0)).thenReturn(true);
105+
when(mockResolver.resolve(SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_4_0)).thenReturn(true);
106106

107107
AzureSpringBootVersionVerifier versionVerifier = new AzureSpringBootVersionVerifier(acceptedVersions,
108108
mockResolver) {
@@ -115,11 +115,11 @@ String getVersionFromManifest() {
115115
}
116116

117117
@ParameterizedTest
118-
@ValueSource(strings = { "3.0.0-M4" })
118+
@ValueSource(strings = { "4.0.0-M4" })
119119
void shouldNotMatchWhenManifestNumberNotPresentAndAcceptedNumberSpecifiedCase3(String acceptedVersion) {
120120
List<String> acceptedVersions = Collections.singletonList(acceptedVersion);
121121
ClassNameResolverPredicate mockResolver = mock(ClassNameResolverPredicate.class);
122-
when(mockResolver.resolve(SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_0)).thenReturn(true);
122+
when(mockResolver.resolve(SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_4_0)).thenReturn(true);
123123

124124
AzureSpringBootVersionVerifier versionVerifier = new AzureSpringBootVersionVerifier(acceptedVersions,
125125
mockResolver) {
@@ -133,11 +133,11 @@ String getVersionFromManifest() {
133133

134134

135135
@ParameterizedTest
136-
@ValueSource(strings = { "3.0", "3.0.x" })
136+
@ValueSource(strings = { "4.0", "4.0.x" })
137137
void shouldNotMatchWhenManifestNumberNotPresentAndAcceptedNumberSpecifiedCase4(String acceptedVersion) {
138138
List<String> acceptedVersions = Collections.singletonList(acceptedVersion);
139139
ClassNameResolverPredicate mockResolver = mock(ClassNameResolverPredicate.class);
140-
when(mockResolver.resolve(SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_3_0)).thenReturn(false);
140+
when(mockResolver.resolve(SPRINGBOOT_CONDITIONAL_CLASS_NAME_OF_4_0)).thenReturn(false);
141141

142142
AzureSpringBootVersionVerifier versionVerifier = new AzureSpringBootVersionVerifier(acceptedVersions,
143143
mockResolver) {

0 commit comments

Comments
 (0)