Remove WireMock usage in repo - #50114
Conversation
There was a problem hiding this comment.
Pull request overview
Removes WireMock usage from the repo (and related configuration) to keep test infrastructure compatible with Java 8 and simplify test setup by using in-process HTTP mocking.
Changes:
- Removed the WireMock backend option from
azure-core-perfstress options and docs. - Reworked
LROPollerTeststo useHttpClient+MockHttpResponseinstead of a WireMock server. - Removed
wiremock-jre8-standalonedependencies (and related versioning references) from affected modules.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/core/azure-core-perf/src/test/java/com/azure/core/perf/CorePerfIntegrationTest.java | Removes WireMock backend test permutations. |
| sdk/core/azure-core-perf/src/main/java/com/azure/core/perf/core/RestProxyTestBase.java | Deletes WireMock server setup/cleanup logic. |
| sdk/core/azure-core-perf/src/main/java/com/azure/core/perf/core/CorePerfStressOptions.java | Removes WIREMOCK from backend options and updates docs. |
| sdk/core/azure-core-perf/README.md | Removes “Running with Wiremock” instructions. |
| sdk/core/azure-core-perf/pom.xml | Drops WireMock dependency and related enforcer configuration. |
| sdk/core/azure-core-management/src/test/java/com/azure/core/management/implementation/polling/LROPollerTests.java | Replaces WireMock-based LRO tests with HttpClient-based mocks. |
| sdk/core/azure-core-management/pom.xml | Replaces WireMock/Netty test deps with azure-core-test (for MockHttpResponse). |
| sdk/compute/azure-resourcemanager-compute/pom.xml | Removes WireMock test dependency. |
| eng/versioning/external_dependencies.txt | Removes WireMock from tracked external test dependencies. |
Suppressed comments (3)
sdk/core/azure-core-management/src/test/java/com/azure/core/management/implementation/polling/LROPollerTests.java:676
- This assertion only checks that
getFinalResult()returns a non-nullMono, which is always true; it doesn't validate that the final result is produced (and non-null).
StepVerifier.create(lroFlux.last())
.assertNext(response -> assertNotNull(response.getFinalResult()))
.verifyComplete();
sdk/core/azure-core-management/src/test/java/com/azure/core/management/implementation/polling/LROPollerTests.java:41
org.junit.jupiter.api.Assertionsis imported but no longer used after switching to static assertion imports; this will fail compilation due to an unused import.
This issue also appears in the following locations of the same file:
- line 589
- line 674
import com.azure.core.util.serializer.SerializerAdapter;
import com.azure.core.util.serializer.SerializerEncoding;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
sdk/core/azure-core-management/src/test/java/com/azure/core/management/implementation/polling/LROPollerTests.java:593
- The sync-stack timeout test creates a single-thread executor but never shuts it down, and on timeout it doesn't cancel the running poller task. This can leak non-daemon threads and make the test suite flaky/hang.
ExecutorService executor = Executors.newSingleThreadExecutor();
try {
Future<?> future = executor.submit((Runnable) lroPoller::getFinalResult);
future.get(timeoutDuration.toMillis(), TimeUnit.MILLISECONDS);
} catch (TimeoutException e) {
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Description
Removes usage of WireMock as it's been end-of-life for Java 8 in a long time and can be easily replaced by mocking interfaces / removing its usage where it's not really needed.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines