Skip to content

Remove WireMock usage in repo - #50114

Open
Alan Zimmer (alzimmermsft) wants to merge 4 commits into
Azure:mainfrom
alzimmermsft:RemoveWiremockFromRepo
Open

Remove WireMock usage in repo#50114
Alan Zimmer (alzimmermsft) wants to merge 4 commits into
Azure:mainfrom
alzimmermsft:RemoveWiremockFromRepo

Conversation

@alzimmermsft

Copy link
Copy Markdown
Member

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:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-perf stress options and docs.
  • Reworked LROPollerTests to use HttpClient + MockHttpResponse instead of a WireMock server.
  • Removed wiremock-jre8-standalone dependencies (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-null Mono, 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.Assertions is 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure.Core azure-core Mgmt This issue is related to a management-plane library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants