仓库指标
- 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.xml—wiremock.versionproperty + dependencyManagement entrycore/pom.xml— wiremock dependencyjunit5-testing-examples/pom.xml— wiremock exclusion entrypom_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, staticwireMockServer
field), keep non-WireMock (Virtuoso) partscore/.../engine/mocker/HandlebarsLocalDateHelper.java— delete entirely (WireMock Handlebars helper)core/.../engine/executor/httpapi/HttpApiExecutorImpl.java— remove$USE.WIREMOCKbranch,mockPortfield,createWithWireMockimportcore/.../runner/ZeroCodeMultiStepsScenarioRunnerImpl.java— removestopIfWireMockServerRunning()and its call/importcore/.../domain/MockStep.java— update stale commentcore/.../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) — deleteBasicHttpClientTest.java,SslTrustHttpClientTest.java,RetryWithStateTest.java,ZeroCodeMultiStepsScenarioRunnerImplRetryTest.java— these use WireMock only as a generic HTTP stub server (unrelated
to the$USE.WIREMOCKfeature); 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 the06_will_mock_using_wiremock_and_run_other_steps.jsonreference- 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— dropmock.api.port/ related comments
http-testing-examples module:
.../wiremock/ZeroCodeWireMockRunner.java,JustHelloImplicitDelayTimeOutTest.java,.../wiremock/WireMockCustomerEndPointTest.java— deletecustomer_web_app.properties,localhost_app.properties— drop WireMock comments/port configwiremock_tests/*.jsonfixtures — 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 (
RestEndPointMockerwiremock methods,HandlebarsLocalDateHelper,$USE.WIREMOCKdispatch inHttpApiExecutorImpl, teardown hook inZeroCodeMultiStepsScenarioRunnerImpl) 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-examplesWireMock 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)