authorjapps/zerocode

Remove WireMock feature (dependency, code, tests)

Open

#783 创建于 2026年7月15日

在 GitHub 查看
 (2 评论) (0 反应) (1 负责人)Java (447 fork)auto 404
good first issue

仓库指标

Star
 (1,010 star)
PR 合并指标
 (PR 指标待抓取)

描述

Remove WireMock feature (dependency, code, tests) from master.

Just a heads-up: we'll be removing the WireMock feature (dependency, code, tests) from master. To be clear, 
you can still use WireMock -- just directly via its own DSL, without wiring through the Zerocode DSL. 
You're free to write and store your WireMock JSON files anywhere in (or outside) your automation project, 
however it suits you.

Once this PR is merged, WireMock will no longer be integrated with the Zerocode DSL(i.e. the extra layer to achieve the same thing) for 
mock features (e.g. HTTP mocks). 

Description

Branch java17 already dropped WireMock in commit 51120fbb ("Removed WireMock dependency before migrating to Java17(min)") while migrating to the JUnit5 engine. That commit is the direct reference for this work which can be reused/picked

Reference: branch/commit

  • Branch: java17

Removal details (master)

Maven:

  • pom.xmlwiremock.version property + dependencyManagement entry
  • core/pom.xml — wiremock dependency
  • junit5-testing-examples/pom.xml — wiremock exclusion entry
  • pom_OSSRH_NOTINUSE.xml, core/pom_OSSRH_NOTINUSE.xml — same entries (not present in java17 commit, extra on master)

Core main code:

  • core/.../engine/mocker/RestEndPointMocker.java — strip WireMock methods (createWithWireMock, restartWireMock, stopWireMockServer, getWireMockServer, getWiremockHelpers, static wireMockServer
    field), keep non-WireMock (Virtuoso) parts
  • core/.../engine/mocker/HandlebarsLocalDateHelper.java — delete entirely (WireMock Handlebars helper)
  • core/.../engine/executor/httpapi/HttpApiExecutorImpl.java — remove $USE.WIREMOCK branch, mockPort field, createWithWireMock import
  • core/.../runner/ZeroCodeMultiStepsScenarioRunnerImpl.java — remove stopIfWireMockServerRunning() and its call/import
  • core/.../domain/MockStep.java — update stale comment
  • core/.../zzignored/mocking/WireMockJsonContentTesting.java — delete (dead code)
  • core/.../engine/executor/ApiServiceExecutorImpl.java — has its own @Named("mock.api.port") field, NOT touched by the java17 commit; decide separately whether it's dead weight or still needed

Core tests + fixtures:

  • MockStepTest.java, RestEndPointMockerTest.java, WireMockIntegrationTest.java (whole class) — delete
  • BasicHttpClientTest.java, SslTrustHttpClientTest.java, RetryWithStateTest.java, ZeroCodeMultiStepsScenarioRunnerImplRetryTest.java — these use WireMock only as a generic HTTP stub server (unrelated
    to the $USE.WIREMOCK feature); java17 commit deletes them outright — same call here, or replace stub server if that coverage should be kept (flagging as an open call, not deciding it in this issue)
  • SmartJUnitRunnerTestCases.java — drop the 06_will_mock_using_wiremock_and_run_other_steps.json reference
  • All unit_test_files/wiremock/*.json, integration_test_files/wiremock_integration/*.json, integration_test_files/retry_test_cases/*.json,
    integration_test_files/json_paths_jayway/06_will_mock_using_wiremock_and_run_other_steps.json — delete/rework
  • web_app.properties, dev_test.properties — drop mock.api.port / related comments

http-testing-examples module:

  • .../wiremock/ZeroCodeWireMockRunner.java, JustHelloImplicitDelayTimeOutTest.java, .../wiremock/WireMockCustomerEndPointTest.java — delete
  • customer_web_app.properties, localhost_app.properties — drop WireMock comments/port config
  • wiremock_tests/*.json fixtures — delete

Docs:

  • CI.md : drop stale note about "WireMock 3.x needs JDK11" upgrade context

Acceptance Criteria

  • WireMock maven dependency fully removed from pom.xml, core/pom.xml, junit5-testing-examples/pom.xml (and OSSRH poms), build is green with no wiremock jar on the classpath.
  • All WireMock-specific code (RestEndPointMocker wiremock methods, HandlebarsLocalDateHelper, $USE.WIREMOCK dispatch in HttpApiExecutorImpl, teardown hook in ZeroCodeMultiStepsScenarioRunnerImpl) removed; Virtuoso mock strategy ($USE.VIRTUOSO) continues working unaffected.
  • All WireMock-only tests/fixtures removed; for the tests that used WireMock merely as a generic HTTP stub server (BasicHttpClientTest, SslTrustHttpClientTest, RetryWithStateTest, retry-loop tests), an explicit decision is made and documented: drop the coverage (matching java17) or replace the stub server.
  • http-testing-examples WireMock example package and fixtures removed; module still builds/tests green.
  • No leftover "wiremock" references anywhere in the repo except this issue/PR history :)

Refer and reuse the wiremock removal code only from the branch "java17" wherever possible

PR for reference: https://github.com/authorjapps/zerocode/pull/752 (only pick wiremock deletion from here, do not pick any Java17 related code from this repo as this repo is In-Progress towards Java17, but Wiremock work is completed)

贡献者指南