diff --git a/common/ManagementTestShared/Redesign/ManagementRecordedTestBase.cs b/common/ManagementTestShared/Redesign/ManagementRecordedTestBase.cs index ba12e698ad25..7c629df896f9 100644 --- a/common/ManagementTestShared/Redesign/ManagementRecordedTestBase.cs +++ b/common/ManagementTestShared/Redesign/ManagementRecordedTestBase.cs @@ -39,7 +39,7 @@ public abstract class ManagementRecordedTestBase : RecordedTestBas private ResourceType _resourceType; protected string ApiVersion { get; } - protected ManagementRecordedTestBase(bool isAsync, RecordedTestMode? mode = default, bool ignoreArmCoreDependencyVersions = true) + protected ManagementRecordedTestBase(bool isAsync, RecordedTestMode? mode = default) : base(isAsync, mode) { AdditionalInterceptors = new[] { new ManagementInterceptor(this) }; @@ -47,14 +47,11 @@ protected ManagementRecordedTestBase(bool isAsync, RecordedTestMode? mode = defa SessionEnvironment = new TEnvironment(); SessionEnvironment.Mode = Mode; Initialize(); - if (ignoreArmCoreDependencyVersions) - { - IgnoreArmCoreDependencyVersions(); - } + IgnoredQueryParameters.Add("api-version"); } - protected ManagementRecordedTestBase(bool isAsync, ResourceType resourceType, string apiVersion, RecordedTestMode? mode = default, bool ignoreArmCoreDependencyVersions = true) - : this(isAsync, mode, ignoreArmCoreDependencyVersions) + protected ManagementRecordedTestBase(bool isAsync, ResourceType resourceType, string apiVersion, RecordedTestMode? mode = default) + : this(isAsync, mode) { _resourceType = resourceType; ApiVersion = apiVersion; @@ -71,79 +68,6 @@ private void Initialize() _waitForCleanup = Mode == RecordedTestMode.Live ? WaitUntil.Completed : WaitUntil.Started; } - private void IgnoreArmCoreDependencyVersions() - { - // Ignore the api-version of tenant operations - UriRegexSanitizers.Add(new UriRegexSanitizer( - @"/tenants\?api-version=(?[a-z0-9-]+)", "**" - ) - { - GroupForReplace = "group" - }); - // Ignore the api-version of subscription operations - UriRegexSanitizers.Add(new UriRegexSanitizer( - @"/subscriptions/[^/]+api-version=(?[a-z0-9-]+)", "**" - ) - { - GroupForReplace = "group" - }); - UriRegexSanitizers.Add(new UriRegexSanitizer( - @"/subscriptions/([^/]+)/locations\?api-version=(?[a-z0-9-]+)", "**" - ) - { - GroupForReplace = "group" - }); - // Ignore the api-version of resource group operations - UriRegexSanitizers.Add(new UriRegexSanitizer( - @"/resourcegroups/[^/]+api-version=(?[a-z0-9-]+)", "**" - ) - { - GroupForReplace = "group" - }); - // Ignore the api-version of LRO query status operation for resource group deletion - UriRegexSanitizers.Add(new UriRegexSanitizer( - @"/subscriptions/[^/]+/operationresults/[^/]+api-version=(?[a-z0-9-]+)", "**" - ) - { - GroupForReplace = "group" - }); - // Ignore the api-version of TagResource operations - UriRegexSanitizers.Add(new UriRegexSanitizer( - @"/providers/Microsoft.Resources/tags/default\?api-version=(?[a-z0-9-]+)", "**" - ) - { - GroupForReplace = "group" - }); - // Ignore the api-version of the operation to query resource providers - UriRegexSanitizers.Add(new UriRegexSanitizer( - @"/providers/([^/]+)api-version=(?[a-z0-9-]+)", "**" - ) - { - GroupForReplace = "group" - }); - // Ignore the api-version of PolicyAssignments operations - UriRegexSanitizers.Add(new UriRegexSanitizer( - @"/providers\/Microsoft.Authorization\/policyAssignments(.*?)\?api-version=(?[a-z0-9-]+)", "**" - ) - { - GroupForReplace = "group" - }); - // Ignore the api-version of PolicyDefinitions operations - UriRegexSanitizers.Add(new UriRegexSanitizer( - @"/providers\/Microsoft.Authorization\/policyDefinitions(.*?)\?api-version=(?[a-z0-9-]+)", "**" - ) - { - GroupForReplace = "group" - }); - // Ignore the api-version of PolicySetDefinitions operations - UriRegexSanitizers.Add(new UriRegexSanitizer( - @"/providers\/Microsoft.Authorization\/policySetDefinitions(.*?)\?api-version=(?[a-z0-9-]+)", "**" - ) - { - GroupForReplace = "group" - }); - } - protected void IgnoreNetworkDependencyVersions() { // Ignore the api-version of Network operations