diff --git a/sdk/spring/CHANGELOG.md b/sdk/spring/CHANGELOG.md index ef8504220e9d..2ec6ab1939e4 100644 --- a/sdk/spring/CHANGELOG.md +++ b/sdk/spring/CHANGELOG.md @@ -47,6 +47,11 @@ This section includes changes in `spring-cloud-azure-stream-binder-eventhubs` mo ### Spring Cloud Azure Native Reachability This library is deprecated, and all the reachability metadata have been incorporated into each Spring Cloud Azure library's source code directly. +### 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` and remove `AzureEnvironmentProperties.AZURE_GERMANY` [#34663](https://github.com/Azure/azure-sdk-for-java/pull/34663). ## 5.0.0 (2023-01-17) - This release is compatible with Spring Boot 3.0.0-3.0.1. (Note: 3.0.x (x>1) 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/implementation/aad/configuration/properties/AadProfileProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/aad/configuration/properties/AadProfileProperties.java index 434ee5eed17d..0c8993c5c349 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/aad/configuration/properties/AadProfileProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/aad/configuration/properties/AadProfileProperties.java @@ -15,7 +15,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/implementation/properties/core/profile/AzureProfileConfigurationProperties.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/profile/AzureProfileConfigurationProperties.java index b32155fce055..542558ed03d0 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/properties/core/profile/AzureProfileConfigurationProperties.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/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 66fd5248f14d..0ca3aed5c6d2 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 @@ -297,7 +297,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.implementation.properties.core.profile.AzureProfileConfigurationProperties" }, { @@ -586,7 +586,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.AzurePasswordlessProperties" }, { diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/eventhubs/AzureEventHubsAutoConfigurationTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/eventhubs/AzureEventHubsAutoConfigurationTests.java index 335bae19ee11..09dacc93710c 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/eventhubs/AzureEventHubsAutoConfigurationTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/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/AzureServiceBusAutoConfigurationTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/servicebus/AzureServiceBusAutoConfigurationTests.java index fc58cc587dcd..37d22c3e300d 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/servicebus/AzureServiceBusAutoConfigurationTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/servicebus/AzureServiceBusAutoConfigurationTests.java @@ -100,7 +100,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) @@ -110,8 +110,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-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-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..63cfa2c253e2 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 @@ -25,13 +25,6 @@ public class AzureEnvironmentProperties implements AzureProfileOptionsProvider.A setServiceBusDomainName("servicebus.chinacloudapi.cn"); }}; - /** - * Provides the environment instance for Azure Germany. - */ - public static final AzureEnvironmentProperties AZURE_GERMANY = new AzureEnvironmentProperties(AzureEnvironment.AZURE_GERMANY) {{ - setServiceBusDomainName("servicebus.cloudapi.de"); - }}; - /** * Provides the environment instance for Azure US Government. */ 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-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()); } }