diff --git a/sdk/fluidrelay/azure-resourcemanager-fluidrelay/src/test/java/com/azure/resourcemanager/fluidrelay/FluidRelayManagerTests.java b/sdk/fluidrelay/azure-resourcemanager-fluidrelay/src/test/java/com/azure/resourcemanager/fluidrelay/FluidRelayManagerTests.java index 78ba328ec3a02..c34a141c99caf 100644 --- a/sdk/fluidrelay/azure-resourcemanager-fluidrelay/src/test/java/com/azure/resourcemanager/fluidrelay/FluidRelayManagerTests.java +++ b/sdk/fluidrelay/azure-resourcemanager-fluidrelay/src/test/java/com/azure/resourcemanager/fluidrelay/FluidRelayManagerTests.java @@ -16,6 +16,7 @@ import com.azure.identity.AzurePowerShellCredentialBuilder; import com.azure.resourcemanager.fluidrelay.models.FluidRelayServer; import com.azure.resourcemanager.resources.ResourceManager; +import com.azure.resourcemanager.resources.fluentcore.policy.ProviderRegistrationPolicy; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -34,15 +35,16 @@ public void beforeTest() { final TokenCredential credential = new AzurePowerShellCredentialBuilder().build(); final AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); - fluidRelayManager = FluidRelayManager.configure() - .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) - .authenticate(credential, profile); - resourceManager = ResourceManager.configure() .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) .authenticate(credential, profile) .withDefaultSubscription(); + fluidRelayManager = FluidRelayManager.configure() + .withPolicy(new ProviderRegistrationPolicy(resourceManager)) + .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) + .authenticate(credential, profile); + // use AZURE_RESOURCE_GROUP_NAME if run in LIVE CI String testResourceGroup = Configuration.getGlobalConfiguration().get("AZURE_RESOURCE_GROUP_NAME"); testEnv = !CoreUtils.isNullOrEmpty(testResourceGroup); diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/test/java/com/azure/resourcemanager/frontdoor/FrontDoorManagerTests.java b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/test/java/com/azure/resourcemanager/frontdoor/FrontDoorManagerTests.java index 2a268993cf1e5..ec3bf55422ddf 100644 --- a/sdk/frontdoor/azure-resourcemanager-frontdoor/src/test/java/com/azure/resourcemanager/frontdoor/FrontDoorManagerTests.java +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/src/test/java/com/azure/resourcemanager/frontdoor/FrontDoorManagerTests.java @@ -16,6 +16,7 @@ import com.azure.identity.AzurePowerShellCredentialBuilder; import com.azure.resourcemanager.frontdoor.models.WebApplicationFirewallPolicy; import com.azure.resourcemanager.resources.ResourceManager; +import com.azure.resourcemanager.resources.fluentcore.policy.ProviderRegistrationPolicy; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -34,15 +35,16 @@ public void beforeTest() { final TokenCredential credential = new AzurePowerShellCredentialBuilder().build(); final AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); - frontDoorManager = FrontDoorManager.configure() - .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) - .authenticate(credential, profile); - resourceManager = ResourceManager.configure() .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) .authenticate(credential, profile) .withDefaultSubscription(); + frontDoorManager = FrontDoorManager.configure() + .withPolicy(new ProviderRegistrationPolicy(resourceManager)) + .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) + .authenticate(credential, profile); + // use AZURE_RESOURCE_GROUP_NAME if run in LIVE CI String testResourceGroup = Configuration.getGlobalConfiguration().get("AZURE_RESOURCE_GROUP_NAME"); testEnv = !CoreUtils.isNullOrEmpty(testResourceGroup); diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/test/java/com/azure/resourcemanager/healthcareapis/HealthcareApisManagerTests.java b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/test/java/com/azure/resourcemanager/healthcareapis/HealthcareApisManagerTests.java index 7e074dbbdea8c..52a90b518e779 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/test/java/com/azure/resourcemanager/healthcareapis/HealthcareApisManagerTests.java +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/test/java/com/azure/resourcemanager/healthcareapis/HealthcareApisManagerTests.java @@ -16,6 +16,7 @@ import com.azure.identity.AzurePowerShellCredentialBuilder; import com.azure.resourcemanager.healthcareapis.models.*; import com.azure.resourcemanager.resources.ResourceManager; +import com.azure.resourcemanager.resources.fluentcore.policy.ProviderRegistrationPolicy; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -34,15 +35,16 @@ public void beforeTest() { final TokenCredential credential = new AzurePowerShellCredentialBuilder().build(); final AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); - healthcareApisManager = HealthcareApisManager.configure() - .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) - .authenticate(credential, profile); - resourceManager = ResourceManager.configure() .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) .authenticate(credential, profile) .withDefaultSubscription(); + healthcareApisManager = HealthcareApisManager.configure() + .withPolicy(new ProviderRegistrationPolicy(resourceManager)) + .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) + .authenticate(credential, profile); + // use AZURE_RESOURCE_GROUP_NAME if run in LIVE CI String testResourceGroup = Configuration.getGlobalConfiguration().get("AZURE_RESOURCE_GROUP_NAME"); testEnv = !CoreUtils.isNullOrEmpty(testResourceGroup); diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/test/java/com/azure/resourcemanager/imagebuilder/ImageBuilderManagerTests.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/test/java/com/azure/resourcemanager/imagebuilder/ImageBuilderManagerTests.java index 380dc052f0a2e..95d82fb588fdb 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/test/java/com/azure/resourcemanager/imagebuilder/ImageBuilderManagerTests.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/test/java/com/azure/resourcemanager/imagebuilder/ImageBuilderManagerTests.java @@ -25,6 +25,7 @@ import com.azure.resourcemanager.msi.MsiManager; import com.azure.resourcemanager.msi.models.Identity; import com.azure.resourcemanager.resources.ResourceManager; +import com.azure.resourcemanager.resources.fluentcore.policy.ProviderRegistrationPolicy; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -47,19 +48,21 @@ public void beforeTest() { final TokenCredential credential = new AzurePowerShellCredentialBuilder().build(); final AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); + resourceManager = ResourceManager.configure() + .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) + .authenticate(credential, profile) + .withDefaultSubscription(); + imageBuilderManager = ImageBuilderManager.configure() + .withPolicy(new ProviderRegistrationPolicy(resourceManager)) .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) .authenticate(credential, profile); msiManager = MsiManager.configure() + .withPolicy(new ProviderRegistrationPolicy(resourceManager)) .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) .authenticate(credential, profile); - resourceManager = ResourceManager.configure() - .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) - .authenticate(credential, profile) - .withDefaultSubscription(); - // use AZURE_RESOURCE_GROUP_NAME if run in LIVE CI String testResourceGroup = Configuration.getGlobalConfiguration().get("AZURE_RESOURCE_GROUP_NAME"); testEnv = !CoreUtils.isNullOrEmpty(testResourceGroup); diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/test/java/com/azure/resourcemanager/iotcentral/IotCentralManagerTests.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/test/java/com/azure/resourcemanager/iotcentral/IotCentralManagerTests.java index 5f326702fdfea..d249730ebb177 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/test/java/com/azure/resourcemanager/iotcentral/IotCentralManagerTests.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/test/java/com/azure/resourcemanager/iotcentral/IotCentralManagerTests.java @@ -23,6 +23,7 @@ import com.azure.resourcemanager.iotcentral.models.SystemAssignedServiceIdentity; import com.azure.resourcemanager.iotcentral.models.SystemAssignedServiceIdentityType; import com.azure.resourcemanager.resources.ResourceManager; +import com.azure.resourcemanager.resources.fluentcore.policy.ProviderRegistrationPolicy; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -42,15 +43,16 @@ public void beforeTest() { final TokenCredential credential = new AzurePowerShellCredentialBuilder().build(); final AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); - iotCentralManager = IotCentralManager.configure() - .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) - .authenticate(credential, profile); - resourceManager = ResourceManager.configure() .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) .authenticate(credential, profile) .withDefaultSubscription(); + iotCentralManager = IotCentralManager.configure() + .withPolicy(new ProviderRegistrationPolicy(resourceManager)) + .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) + .authenticate(credential, profile); + // use AZURE_RESOURCE_GROUP_NAME if run in LIVE CI String testResourceGroup = Configuration.getGlobalConfiguration().get("AZURE_RESOURCE_GROUP_NAME"); testEnv = !CoreUtils.isNullOrEmpty(testResourceGroup); diff --git a/sdk/iotfirmwaredefense/azure-resourcemanager-iotfirmwaredefense/src/test/java/com/azure/resourcemanager/iotfirmwaredefense/IoTFirmwareDefenseManagerTests.java b/sdk/iotfirmwaredefense/azure-resourcemanager-iotfirmwaredefense/src/test/java/com/azure/resourcemanager/iotfirmwaredefense/IoTFirmwareDefenseManagerTests.java index b21f21cf34943..e6c67960f5e10 100644 --- a/sdk/iotfirmwaredefense/azure-resourcemanager-iotfirmwaredefense/src/test/java/com/azure/resourcemanager/iotfirmwaredefense/IoTFirmwareDefenseManagerTests.java +++ b/sdk/iotfirmwaredefense/azure-resourcemanager-iotfirmwaredefense/src/test/java/com/azure/resourcemanager/iotfirmwaredefense/IoTFirmwareDefenseManagerTests.java @@ -16,6 +16,7 @@ import com.azure.identity.AzurePowerShellCredentialBuilder; import com.azure.resourcemanager.iotfirmwaredefense.models.Workspace; import com.azure.resourcemanager.resources.ResourceManager; +import com.azure.resourcemanager.resources.fluentcore.policy.ProviderRegistrationPolicy; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -34,15 +35,16 @@ public void beforeTest() { final TokenCredential credential = new AzurePowerShellCredentialBuilder().build(); final AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); - ioTFirmwareDefenseManager = IoTFirmwareDefenseManager.configure() - .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) - .authenticate(credential, profile); - resourceManager = ResourceManager.configure() .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) .authenticate(credential, profile) .withDefaultSubscription(); + ioTFirmwareDefenseManager = IoTFirmwareDefenseManager.configure() + .withPolicy(new ProviderRegistrationPolicy(resourceManager)) + .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) + .authenticate(credential, profile); + // use AZURE_RESOURCE_GROUP_NAME if run in LIVE CI String testResourceGroup = Configuration.getGlobalConfiguration().get("AZURE_RESOURCE_GROUP_NAME"); testEnv = !CoreUtils.isNullOrEmpty(testResourceGroup); diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/IotHubManagerTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/IotHubManagerTests.java index bd55047f74ee5..038bf020ec195 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/IotHubManagerTests.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/IotHubManagerTests.java @@ -30,6 +30,7 @@ import com.azure.resourcemanager.iothub.models.ResourceIdentityType; import com.azure.resourcemanager.iothub.models.StorageEndpointProperties; import com.azure.resourcemanager.resources.ResourceManager; +import com.azure.resourcemanager.resources.fluentcore.policy.ProviderRegistrationPolicy; import io.netty.util.internal.StringUtil; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -54,15 +55,16 @@ public void beforeTest() { final TokenCredential credential = new AzurePowerShellCredentialBuilder().build(); final AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); - iotHubManager = IotHubManager.configure() - .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) - .authenticate(credential, profile); - resourceManager = ResourceManager.configure() .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) .authenticate(credential, profile) .withDefaultSubscription(); + iotHubManager = IotHubManager.configure() + .withPolicy(new ProviderRegistrationPolicy(resourceManager)) + .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) + .authenticate(credential, profile); + // use AZURE_RESOURCE_GROUP_NAME if run in LIVE CI String testResourceGroup = Configuration.getGlobalConfiguration().get("AZURE_RESOURCE_GROUP_NAME"); testEnv = !CoreUtils.isNullOrEmpty(testResourceGroup); diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/KustoManagerTests.java b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/KustoManagerTests.java index 214a7afe1697e..6457afbb1bc34 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/KustoManagerTests.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/test/java/com/azure/resourcemanager/kusto/KustoManagerTests.java @@ -19,6 +19,7 @@ import com.azure.resourcemanager.kusto.models.AzureSkuTier; import com.azure.resourcemanager.kusto.models.Cluster; import com.azure.resourcemanager.resources.ResourceManager; +import com.azure.resourcemanager.resources.fluentcore.policy.ProviderRegistrationPolicy; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -37,15 +38,16 @@ public void beforeTest() { final TokenCredential credential = new AzurePowerShellCredentialBuilder().build(); final AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); - kustoManager = KustoManager.configure() - .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) - .authenticate(credential, profile); - resourceManager = ResourceManager.configure() .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) .authenticate(credential, profile) .withDefaultSubscription(); + kustoManager = KustoManager.configure() + .withPolicy(new ProviderRegistrationPolicy(resourceManager)) + .withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) + .authenticate(credential, profile); + // use AZURE_RESOURCE_GROUP_NAME if run in LIVE CI String testResourceGroup = Configuration.getGlobalConfiguration().get("AZURE_RESOURCE_GROUP_NAME"); testEnv = !CoreUtils.isNullOrEmpty(testResourceGroup);