diff --git a/eng/code-quality-reports/src/main/resources/revapi/revapi.json b/eng/code-quality-reports/src/main/resources/revapi/revapi.json index 557319945a5f..1dccbdd15ffc 100644 --- a/eng/code-quality-reports/src/main/resources/revapi/revapi.json +++ b/eng/code-quality-reports/src/main/resources/revapi/revapi.json @@ -230,6 +230,11 @@ "code": "java\\.annotation\\.removed", "old": ".*? com\\.azure\\.search\\.documents(\\.indexes)?\\.models.*", "justification": "Removing Jackson annotations from Search in transition to stream-style." + }, + { + "code": "java.field.removed", + "old": "field com.azure.spring.cloud.core.properties.profile.AzureEnvironmentProperties.AZURE_GERMANY", + "justification": "Remove this because AZURE_GERMANY is deprecated." } ] } diff --git a/sdk/spring/CHANGELOG.md b/sdk/spring/CHANGELOG.md index 6eed8277b56e..5abda33032dd 100644 --- a/sdk/spring/CHANGELOG.md +++ b/sdk/spring/CHANGELOG.md @@ -1,5 +1,19 @@ # Release History +## 4.8.0-beta.1 (unreleased) + +### Spring Cloud Azure Core +This section includes changes in `spring-cloud-azure-core`, `spring-cloud-azure-service`, and `spring-cloud-azure-resourcemanager` modules. + +#### Breaking Changes +- Deprecated `CloudType.AZURE_GERMANY`, `JDBC_SCOPE_AZURE_GERMANY`, `REDIS_SCOPE_AZURE_GERMANY`, `AzureEnvironmentProperties.AZURE_GERMANY` [#34682](https://github.com/Azure/azure-sdk-for-java/pull/34682). + +### Spring Cloud Azure Autoconfigure +This section includes changes in `spring-cloud-azure-autoconfigure` module. + +#### Breaking Changes +- Deprecated `SERVICE_BUS_SCOPE_AZURE_GERMANY` [#34682](https://github.com/Azure/azure-sdk-for-java/pull/34682). + ## 4.7.0 (2023-03-23) - This release is compatible with Spring Boot 2.5.0-2.5.14, 2.6.0-2.6.14, 2.7.0-2.7.9. (Note: 2.5.x (x>14), 2.6.y (y>14) and 2.7.z (z>9) should be supported, but they aren't tested with this release.) - This release is compatible with Spring Cloud 2020.0.3-2020.0.6, 2021.0.0-2021.0.5. (Note: 2020.0.x (x>6) and 2021.0.y (y>5) should be supported, but they aren't tested with this release.) diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileProperties.java index 786575929761..1082212d8ec5 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileProperties.java @@ -18,7 +18,7 @@ public class AadProfileProperties { */ private String tenantId; // tenantId can not set to "common" here, otherwise we can not know whether it's set by customer or it is the default value. /** - * Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_GERMANY, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`. + * Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`. */ private AzureProfileOptionsProvider.CloudType cloudType; /** diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/properties/AzureServiceBusJmsProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/properties/AzureServiceBusJmsProperties.java index 881b309b4c19..5a6ba12cffed 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/properties/AzureServiceBusJmsProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/properties/AzureServiceBusJmsProperties.java @@ -30,6 +30,10 @@ public class AzureServiceBusJmsProperties implements InitializingBean, Passwordl private static final String SERVICE_BUS_SCOPE_AZURE = "https://servicebus.azure.net/.default"; private static final String SERVICE_BUS_SCOPE_AZURE_CHINA = SERVICE_BUS_SCOPE_AZURE; + /** + * @deprecated AZURE_GERMANY is deprecated. Please use other Service Bus scopes. + */ + @Deprecated private static final String SERVICE_BUS_SCOPE_AZURE_GERMANY = SERVICE_BUS_SCOPE_AZURE; private static final String SERVICE_BUS_SCOPE_AZURE_US_GOVERNMENT = SERVICE_BUS_SCOPE_AZURE; @@ -37,7 +41,6 @@ public class AzureServiceBusJmsProperties implements InitializingBean, Passwordl { put(CloudType.AZURE, SERVICE_BUS_SCOPE_AZURE); put(CloudType.AZURE_CHINA, SERVICE_BUS_SCOPE_AZURE_CHINA); - put(CloudType.AZURE_GERMANY, SERVICE_BUS_SCOPE_AZURE_GERMANY); put(CloudType.AZURE_US_GOVERNMENT, SERVICE_BUS_SCOPE_AZURE_US_GOVERNMENT); } }; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java index 1a8f7504a025..8cd5bc2f2b9b 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java @@ -21,7 +21,7 @@ public class AzureProfileConfigurationProperties extends AzureProfileOptionsAdap */ private String subscriptionId; /** - * Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_GERMANY, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`. + * Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`. */ private AzureProfileOptionsProvider.CloudType cloudType; diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 8147e9658a53..c00b1d798a9d 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -1301,7 +1301,7 @@ { "name": "spring.cloud.azure.keyvault.secret.property-sources[0].profile.cloud-type", "type": "com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider$CloudType", - "description": "Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_GERMANY, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.", + "description": "Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.", "sourceType": "com.azure.spring.cloud.autoconfigure.properties.core.profile.AzureProfileConfigurationProperties" }, { @@ -1590,7 +1590,7 @@ { "name": "spring.datasource.azure.profile.cloud-type", "type": "java.lang.String", - "description": "Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_GERMANY, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.", + "description": "Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.", "sourceType": "com.azure.spring.cloud.service.implementation.passwordless.AzureJdbcPasswordlessProperties" }, { @@ -1658,7 +1658,7 @@ { "name": "spring.redis.azure.profile.cloud-type", "type": "java.lang.String", - "description": "Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_GERMANY, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.", + "description": "Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.", "sourceType": "com.azure.spring.cloud.service.implementation.passwordless.AzureRedisPasswordlessProperties" }, { diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsAutoConfigurationTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsAutoConfigurationTests.java index 1771af30bc89..cccc84dd3665 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsAutoConfigurationTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsAutoConfigurationTests.java @@ -129,7 +129,7 @@ void configureAzureEventHubsPropertiesWithGlobalDefaults() { @Test void configureEventHubsDomainNameOverrideGlobalDefault() { AzureGlobalProperties azureProperties = new AzureGlobalProperties(); - azureProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); + azureProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT); this.contextRunner .withBean(AzureGlobalProperties.class, () -> azureProperties) @@ -140,8 +140,8 @@ void configureEventHubsDomainNameOverrideGlobalDefault() { .run(context -> { assertThat(context).hasSingleBean(AzureEventHubsProperties.class); final AzureEventHubsProperties properties = context.getBean(AzureEventHubsProperties.class); - assertThat(properties.getProfile().getCloudType()).isEqualTo(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); - assertThat(properties.getProfile().getEnvironment().getServiceBusDomainName()).isEqualTo(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName()); + assertThat(properties.getProfile().getCloudType()).isEqualTo(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT); + assertThat(properties.getProfile().getEnvironment().getServiceBusDomainName()).isEqualTo(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName()); assertThat(properties.getDomainName()).isEqualTo(AzureEnvironmentProperties.AZURE_CHINA.getServiceBusDomainName()); }); } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/eventhubs/properties/AzureEventHubsPropertiesTest.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/eventhubs/properties/AzureEventHubsPropertiesTest.java index 119011b70b3d..f1d309242174 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/eventhubs/properties/AzureEventHubsPropertiesTest.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/eventhubs/properties/AzureEventHubsPropertiesTest.java @@ -72,9 +72,9 @@ void getDomainNameFromCloud() { @Test void domainNameOverrideCloud() { AzureEventHubsProperties eventHubsProperties = new AzureEventHubsProperties(); - eventHubsProperties.setDomainName(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName()); + eventHubsProperties.setDomainName(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName()); eventHubsProperties.getProfile().setCloudType(AZURE_CHINA); - assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(), + assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(), eventHubsProperties.getDomainName()); } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/servicebus/properties/AzureServiceBusPropertiesTest.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/servicebus/properties/AzureServiceBusPropertiesTest.java index a2029a14b691..432fba304af4 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/servicebus/properties/AzureServiceBusPropertiesTest.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/servicebus/properties/AzureServiceBusPropertiesTest.java @@ -69,9 +69,9 @@ void getDomainNameFromCloud() { @Test void domainNameOverrideCloud() { AzureServiceBusProperties serviceBusProperties = new AzureServiceBusProperties(); - serviceBusProperties.setDomainName(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName()); + serviceBusProperties.setDomainName(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName()); serviceBusProperties.getProfile().setCloudType(AZURE_CHINA); - assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(), + assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(), serviceBusProperties.getDomainName()); } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/redis/AzureJedisPasswordlessAutoConfigurationTest.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/redis/AzureJedisPasswordlessAutoConfigurationTest.java index 8d19c2b7d1f0..1a041bcef978 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/redis/AzureJedisPasswordlessAutoConfigurationTest.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/redis/AzureJedisPasswordlessAutoConfigurationTest.java @@ -65,11 +65,6 @@ void testScopes() { Assertions.assertEquals(REDIS_SCOPE_CHINA, properties.getScopes()); }); - this.contextRunner.withPropertyValues("spring.redis.azure.profile.cloud-type = AZURE_GERMANY").run((context) -> { - AzureRedisPasswordlessProperties properties = context.getBean(AzureRedisPasswordlessProperties.class); - Assertions.assertEquals(REDIS_SCOPE_GERMANY, properties.getScopes()); - }); - this.contextRunner.withPropertyValues("spring.redis.azure.profile.cloud-type = AZURE_US_GOVERNMENT").run((context) -> { AzureRedisPasswordlessProperties properties = context.getBean(AzureRedisPasswordlessProperties.class); Assertions.assertEquals(REDIS_SCOPE_US_GOVERNMENT, properties.getScopes()); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusAutoConfigurationTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusAutoConfigurationTests.java index 3b83f311e3f6..71ac0839f2d7 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusAutoConfigurationTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusAutoConfigurationTests.java @@ -104,7 +104,7 @@ void configureAzureServiceBusPropertiesWithGlobalDefaults() { @Test void configureServiceBusDomainNameOverrideGlobalDefault() { AzureGlobalProperties azureProperties = new AzureGlobalProperties(); - azureProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); + azureProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT); this.contextRunner .withBean("azureProperties", AzureGlobalProperties.class, () -> azureProperties) @@ -114,8 +114,8 @@ void configureServiceBusDomainNameOverrideGlobalDefault() { .run(context -> { assertThat(context).hasSingleBean(AzureServiceBusProperties.class); final AzureServiceBusProperties properties = context.getBean(AzureServiceBusProperties.class); - assertThat(properties.getProfile().getCloudType()).isEqualTo(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); - assertThat(properties.getProfile().getEnvironment().getServiceBusDomainName()).isEqualTo(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName()); + assertThat(properties.getProfile().getCloudType()).isEqualTo(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT); + assertThat(properties.getProfile().getEnvironment().getServiceBusDomainName()).isEqualTo(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName()); assertThat(properties.getDomainName()).isEqualTo(AzureEnvironmentProperties.AZURE_CHINA.getServiceBusDomainName()); }); } diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureEnvironmentProperties.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureEnvironmentProperties.java index 0ca94b5946fe..bd531447e124 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureEnvironmentProperties.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureEnvironmentProperties.java @@ -27,7 +27,9 @@ public class AzureEnvironmentProperties implements AzureProfileOptionsProvider.A /** * Provides the environment instance for Azure Germany. + * @deprecated AZURE_GERMANY is deprecated. Please use other environment instances. */ + @Deprecated public static final AzureEnvironmentProperties AZURE_GERMANY = new AzureEnvironmentProperties(AzureEnvironment.AZURE_GERMANY) {{ setServiceBusDomainName("servicebus.cloudapi.de"); }}; diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java index d7ea5cde9313..47d845b48d20 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/properties/profile/AzureProfileOptionsAdapter.java @@ -38,8 +38,6 @@ private AzureProfileOptionsProvider.AzureEnvironmentOptions decideAzureEnvironme return AzureEnvironmentProperties.AZURE_CHINA; case AZURE_US_GOVERNMENT: return AzureEnvironmentProperties.AZURE_US_GOVERNMENT; - case AZURE_GERMANY: - return AzureEnvironmentProperties.AZURE_GERMANY; case AZURE: return AzureEnvironmentProperties.AZURE; default: @@ -61,8 +59,6 @@ public static AzureEnvironment decideAzureManagementEnvironment(AzureProfileOpti return AzureEnvironment.AZURE_CHINA; case AZURE_US_GOVERNMENT: return AzureEnvironment.AZURE_US_GOVERNMENT; - case AZURE_GERMANY: - return AzureEnvironment.AZURE_GERMANY; case AZURE: return AzureEnvironment.AZURE; default: diff --git a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/AzureProfileOptionsProvider.java b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/AzureProfileOptionsProvider.java index 6dd0e6cbadb9..14c39115adb4 100644 --- a/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/AzureProfileOptionsProvider.java +++ b/sdk/spring/spring-cloud-azure-core/src/main/java/com/azure/spring/cloud/core/provider/AzureProfileOptionsProvider.java @@ -70,7 +70,9 @@ enum CloudType { /** * Azure Germany + * @deprecated AZURE_GERMANY is deprecated. Please use other CloudTypes. */ + @Deprecated AZURE_GERMANY, /** diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/passwordless/AzureJdbcPasswordlessProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/passwordless/AzureJdbcPasswordlessProperties.java index 689b13a25c0a..0a30f73d82ac 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/passwordless/AzureJdbcPasswordlessProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/passwordless/AzureJdbcPasswordlessProperties.java @@ -17,6 +17,10 @@ public class AzureJdbcPasswordlessProperties implements PasswordlessProperties { private static final String JDBC_SCOPE_AZURE = "https://ossrdbms-aad.database.windows.net/.default"; private static final String JDBC_SCOPE_AZURE_CHINA = "https://ossrdbms-aad.database.chinacloudapi.cn/.default"; + /** + * @deprecated AZURE_GERMANY is deprecated. Please use other JDBC scopes. + */ + @Deprecated private static final String JDBC_SCOPE_AZURE_GERMANY = "https://ossrdbms-aad.database.cloudapi.de/.default"; private static final String JDBC_SCOPE_AZURE_US_GOVERNMENT = "https://ossrdbms-aad.database.usgovcloudapi.net/.default"; @@ -24,7 +28,6 @@ public class AzureJdbcPasswordlessProperties implements PasswordlessProperties { { put(CloudType.AZURE, JDBC_SCOPE_AZURE); put(CloudType.AZURE_CHINA, JDBC_SCOPE_AZURE_CHINA); - put(CloudType.AZURE_GERMANY, JDBC_SCOPE_AZURE_GERMANY); put(CloudType.AZURE_US_GOVERNMENT, JDBC_SCOPE_AZURE_US_GOVERNMENT); } }; diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/passwordless/AzureRedisPasswordlessProperties.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/passwordless/AzureRedisPasswordlessProperties.java index 93bfe4680e0b..9948937b64b9 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/passwordless/AzureRedisPasswordlessProperties.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/passwordless/AzureRedisPasswordlessProperties.java @@ -18,14 +18,17 @@ public class AzureRedisPasswordlessProperties implements PasswordlessProperties private static final String REDIS_SCOPE_AZURE = "https://*.cacheinfra.windows.net:10225/appid/.default"; private static final String REDIS_SCOPE_AZURE_CHINA = "https://*.cacheinfra.windows.net.china:10225/appid/.default"; - private static final String REDIS_SCOPE_AZURE_GERMANY = "https://*.cacheinfra.windows.net.germany:10225/appid/.default"; + /** + * @deprecated AZURE_GERMANY is deprecated. Please use other Redis scopes. + */ + @Deprecated + static final String REDIS_SCOPE_AZURE_GERMANY = "https://*.cacheinfra.windows.net.germany:10225/appid/.default"; private static final String REDIS_SCOPE_AZURE_US_GOVERNMENT = "https://*.cacheinfra.windows.us.government.net:10225/appid/.default"; private static final Map REDIS_SCOPE_MAP = new HashMap() { { put(AzureProfileOptionsProvider.CloudType.AZURE, REDIS_SCOPE_AZURE); put(AzureProfileOptionsProvider.CloudType.AZURE_CHINA, REDIS_SCOPE_AZURE_CHINA); - put(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, REDIS_SCOPE_AZURE_GERMANY); put(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, REDIS_SCOPE_AZURE_US_GOVERNMENT); } }; diff --git a/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/passwordless/AzureRedisPasswordlessPropertiesTest.java b/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/passwordless/AzureRedisPasswordlessPropertiesTest.java index 82bb22b7e9d4..719d9f7da385 100644 --- a/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/passwordless/AzureRedisPasswordlessPropertiesTest.java +++ b/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/passwordless/AzureRedisPasswordlessPropertiesTest.java @@ -16,7 +16,6 @@ class AzureRedisPasswordlessPropertiesTest { private static final String REDIS_SCOPE_GLOBAL = "https://*.cacheinfra.windows.net:10225/appid/.default"; private static final String REDIS_SCOPE_CHINA = "https://*.cacheinfra.windows.net.china:10225/appid/.default"; - private static final String REDIS_SCOPE_GERMANY = "https://*.cacheinfra.windows.net.germany:10225/appid/.default"; private static final String REDIS_SCOPE_US_GOVERNMENT = "https://*.cacheinfra.windows.us.government.net:10225/appid/.default"; @Test @@ -31,11 +30,6 @@ void testGetScopes() { String scopes = properties.getScopes(); Assertions.assertEquals(REDIS_SCOPE_GLOBAL, scopes); - profile.setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); - properties.setProfile(profile); - scopes = properties.getScopes(); - Assertions.assertEquals(REDIS_SCOPE_GERMANY, scopes); - profile.setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_CHINA); properties.setProfile(profile); scopes = properties.getScopes(); @@ -64,7 +58,7 @@ void testToProperties() { AzureProfileProperties profile = new AzureProfileProperties(); profile.setTenantId("fake-tenantId"); - profile.setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); + profile.setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT); AzureRedisPasswordlessProperties azureRedisPasswordlessProperties = new AzureRedisPasswordlessProperties(); azureRedisPasswordlessProperties.setScopes("fake-scopes"); diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/core/properties/EventHubsConsumerPropertiesTests.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/core/properties/EventHubsConsumerPropertiesTests.java index 1d9d3c8a1452..988369607edb 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/core/properties/EventHubsConsumerPropertiesTests.java +++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/core/properties/EventHubsConsumerPropertiesTests.java @@ -68,16 +68,16 @@ void domainNameDefaultsToNull() { @Test void domainNameConfigureAsCloud() { - consumerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); - assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, consumerProperties.getProfile().getCloudType()); - assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(), consumerProperties.getDomainName()); + consumerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT); + assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, consumerProperties.getProfile().getCloudType()); + assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(), consumerProperties.getDomainName()); } @Test void customDomainNameShouldSet() { - consumerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); + consumerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT); consumerProperties.setDomainName("new.servicebus.windows.net"); - assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, consumerProperties.getProfile().getCloudType()); + assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, consumerProperties.getProfile().getCloudType()); assertEquals("new.servicebus.windows.net", consumerProperties.getDomainName()); } diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/core/properties/EventHubsProducerPropertiesTests.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/core/properties/EventHubsProducerPropertiesTests.java index b1b9c70d57c8..8f69cb6fbe98 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/core/properties/EventHubsProducerPropertiesTests.java +++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/core/properties/EventHubsProducerPropertiesTests.java @@ -54,16 +54,16 @@ void domainNameDefaultsToNull() { @Test void domainNameConfigureAsCloud() { - producerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); - assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, producerProperties.getProfile().getCloudType()); - assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(), producerProperties.getDomainName()); + producerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT); + assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, producerProperties.getProfile().getCloudType()); + assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(), producerProperties.getDomainName()); } @Test void customDomainNameShouldSet() { producerProperties.setDomainName("new.servicebus.windows.net"); - producerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); - assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, producerProperties.getProfile().getCloudType()); + producerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT); + assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, producerProperties.getProfile().getCloudType()); assertEquals("new.servicebus.windows.net", producerProperties.getDomainName()); } diff --git a/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/src/test/java/com/azure/spring/cloud/stream/binder/servicebus/core/properties/ServiceBusConsumerPropertiesTests.java b/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/src/test/java/com/azure/spring/cloud/stream/binder/servicebus/core/properties/ServiceBusConsumerPropertiesTests.java index 73b57bc631e8..ee1a90d29122 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/src/test/java/com/azure/spring/cloud/stream/binder/servicebus/core/properties/ServiceBusConsumerPropertiesTests.java +++ b/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/src/test/java/com/azure/spring/cloud/stream/binder/servicebus/core/properties/ServiceBusConsumerPropertiesTests.java @@ -112,16 +112,16 @@ void domainNameDefaultsToNull() { @Test void domainNameConfigureAsCloud() { - consumerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); - assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, consumerProperties.getProfile().getCloudType()); - assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(), consumerProperties.getDomainName()); + consumerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT); + assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, consumerProperties.getProfile().getCloudType()); + assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(), consumerProperties.getDomainName()); } @Test void customDomainNameShouldSet() { - consumerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); + consumerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT); consumerProperties.setDomainName("new.servicebus.windows.net"); - assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, consumerProperties.getProfile().getCloudType()); + assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, consumerProperties.getProfile().getCloudType()); assertEquals("new.servicebus.windows.net", consumerProperties.getDomainName()); } diff --git a/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/src/test/java/com/azure/spring/cloud/stream/binder/servicebus/core/properties/ServiceBusProducerPropertiesTests.java b/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/src/test/java/com/azure/spring/cloud/stream/binder/servicebus/core/properties/ServiceBusProducerPropertiesTests.java index bd3e16957fa1..fa9c0d862667 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/src/test/java/com/azure/spring/cloud/stream/binder/servicebus/core/properties/ServiceBusProducerPropertiesTests.java +++ b/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/src/test/java/com/azure/spring/cloud/stream/binder/servicebus/core/properties/ServiceBusProducerPropertiesTests.java @@ -53,16 +53,16 @@ void domainNameDefaultsToNull() { @Test void domainNameConfigureAsCloud() { - producerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); - assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, producerProperties.getProfile().getCloudType()); - assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(), producerProperties.getDomainName()); + producerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT); + assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, producerProperties.getProfile().getCloudType()); + assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(), producerProperties.getDomainName()); } @Test void customDomainNameShouldSet() { producerProperties.setDomainName("new.servicebus.windows.net"); - producerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); - assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, producerProperties.getProfile().getCloudType()); + producerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT); + assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, producerProperties.getProfile().getCloudType()); assertEquals("new.servicebus.windows.net", producerProperties.getDomainName()); } diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/messaging/eventhubs/core/properties/NamespacePropertiesTests.java b/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/messaging/eventhubs/core/properties/NamespacePropertiesTests.java index 7c2d06b7bf48..4507706f6da1 100644 --- a/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/messaging/eventhubs/core/properties/NamespacePropertiesTests.java +++ b/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/messaging/eventhubs/core/properties/NamespacePropertiesTests.java @@ -21,19 +21,19 @@ void domainNameConfigureByDefault() { @Test void domainNameConfiguredAsCloud() { NamespaceProperties namespaceProperties = new NamespaceProperties(); - namespaceProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); + namespaceProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT); - assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, namespaceProperties.getProfile().getCloudType()); - assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(), namespaceProperties.getDomainName()); + assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, namespaceProperties.getProfile().getCloudType()); + assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(), namespaceProperties.getDomainName()); } @Test void domainNameOverrideCloud() { NamespaceProperties namespaceProperties = new NamespaceProperties(); namespaceProperties.setDomainName("servicebus.chinacloudapi.cn"); - namespaceProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); + namespaceProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT); - assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, namespaceProperties.getProfile().getCloudType()); + assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, namespaceProperties.getProfile().getCloudType()); assertEquals(AzureEnvironmentProperties.AZURE_CHINA.getServiceBusDomainName(), namespaceProperties.getDomainName()); } diff --git a/sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/core/properties/NamespacePropertiesTests.java b/sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/core/properties/NamespacePropertiesTests.java index 924ef6877442..0ec042e540db 100644 --- a/sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/core/properties/NamespacePropertiesTests.java +++ b/sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/core/properties/NamespacePropertiesTests.java @@ -21,19 +21,19 @@ void domainNameConfigureByDefault() { @Test void domainNameConfiguredAsCloud() { NamespaceProperties namespaceProperties = new NamespaceProperties(); - namespaceProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); + namespaceProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT); - assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, namespaceProperties.getProfile().getCloudType()); - assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(), namespaceProperties.getDomainName()); + assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, namespaceProperties.getProfile().getCloudType()); + assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(), namespaceProperties.getDomainName()); } @Test void domainNameOverrideCloud() { NamespaceProperties namespaceProperties = new NamespaceProperties(); namespaceProperties.setDomainName("servicebus.chinacloudapi.cn"); - namespaceProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY); + namespaceProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT); - assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, namespaceProperties.getProfile().getCloudType()); + assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, namespaceProperties.getProfile().getCloudType()); assertEquals(AzureEnvironmentProperties.AZURE_CHINA.getServiceBusDomainName(), namespaceProperties.getDomainName()); } }