wiremock / wiremock/wiremock

reset and resetToDefault are doing the same thing

Open
#986 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
7.4k
Forks
1.5k
Avg merge
13h 10m
Merged PRs (30d)
16

Description

According to the documentation at http://wiremock.org/docs/stubbing/ reset and resetToDefault should do different things.

  • reset: The WireMock server can be reset at any time, removing all stub mappings and deleting the request log
  • resetToDefault: If you’ve created some file based stub mappings to be loaded at startup and you don’t want these to disappear when you do a reset you can call WireMock.resetToDefault() instead

However as far as I can tell both calls are doing the same thing.
I can even see it in the code in com.github.tomakehurst.wiremock.core.WireMockApp#resetAll:

    @Override
    public void resetAll() {
        resetToDefaultMappings();
    }

I noticed this behavior in WireMock 2.18.0.
Are there any plans for changing this behavior?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the documented reset and resetToDefault behavior, then inspect com.github.tomakehurst.wiremock.core.WireMockApp#resetAll and the related resetToDefaultMappings path. Verify how file-based stub mappings and the request log are handled, and confirm that the two public operations produce the distinct outcomes described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.