diff --git a/sdk/resourcemanager/azure-resourcemanager-test/CHANGELOG.md b/sdk/resourcemanager/azure-resourcemanager-test/CHANGELOG.md index 0338741465d9..6030e12e56a3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-test/CHANGELOG.md +++ b/sdk/resourcemanager/azure-resourcemanager-test/CHANGELOG.md @@ -1,14 +1,10 @@ # Release History -## 2.0.0-beta.3 (Unreleased) +## 2.0.0-beta.3 (2026-06-01) ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added new `buildManager` overload to `ResourceManagerTestProxyTestBase`, enabling setting long-running operation's default polling interval via entry class. ## 2.0.0-beta.2 (2025-08-20) diff --git a/sdk/resourcemanager/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/ResourceManagerTestProxyTestBase.java b/sdk/resourcemanager/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/ResourceManagerTestProxyTestBase.java index 2fc5149b74a7..9ce30a173fcc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/ResourceManagerTestProxyTestBase.java +++ b/sdk/resourcemanager/azure-resourcemanager-test/src/main/java/com/azure/resourcemanager/test/ResourceManagerTestProxyTestBase.java @@ -474,6 +474,31 @@ protected T buildManager(Class manager, HttpPipeline httpPipeline, AzureP } } + /** + * Builds the manager with provided http pipeline, profile and defaultPollInterval in general manner. + * This is useful when you are doing recording tests and want to share the already set-up HttpPipeline. + * + * @param manager the class of the manager + * @param httpPipeline the http pipeline + * @param profile the azure profile + * @param defaultPollInterval default poll interval for long-running operations + * @param the type of the manager + * @return the manager instance + * @throws RuntimeException when field cannot be found or set. + */ + protected T buildManager(Class manager, HttpPipeline httpPipeline, AzureProfile profile, + Duration defaultPollInterval) { + try { + Constructor constructor = manager.getDeclaredConstructor(httpPipeline.getClass(), profile.getClass(), + defaultPollInterval.getClass()); + setAccessible(constructor); + return constructor.newInstance(httpPipeline, profile, defaultPollInterval); + + } catch (ReflectiveOperationException ex) { + throw LOGGER.logExceptionAsError(new RuntimeException(ex)); + } + } + /** * Builds an HttpPipeline. *