Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix matching of multiple expected zoned date/time values with multiple actual local ones #2650

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

papiomytoglou
Copy link
Contributor

Right now, Wiremock doesn't support matching multiple expected zoned date/time values with multiple actual local ones.

In other words, given the matchers below:

  "request": {
    "method": "GET",
    "urlPath": "/resource",
    "queryParameters": {
      "date": {
        "hasExactly": [
          {
            "equalToDateTime": "now",
            "truncateExpected": "first hour of day",
            "actualFormat": "yyyy-MM-dd"
          },
          {
            "equalToDateTime": "now",
            "expectedOffset": 1,
            "expectedOffsetUnit": "days",
            "truncateExpected": "first hour of day",
            "actualFormat": "yyyy-MM-dd"
          }
        ]
      }
    }
  }

Then a GET request to the URL below should match (assuming the date is March 27th 2024):
/resource?date=2024-03-27&date=2024-03-28
Instead, we get a "request was not matched" message.

This PR add supports for the above scenario and also adds two test cases which fail with the current implementation.

References

An older, related PR: #1925

Submitter checklist

  • Recommended: Join WireMock Slack to get any help in #help-contributing or a project-specific channel like #wiremock-java
  • The PR request is well described and justified, including the body and the references
  • The PR title represents the desired changelog entry
  • The repository's code style is followed (see the contributing guide)
  • Test coverage that demonstrates that the change works as expected
  • For new features, there's necessary documentation in this pull request or in a subsequent PR to wiremock.org

@papiomytoglou papiomytoglou requested a review from a team as a code owner March 27, 2024 14:35
@papiomytoglou papiomytoglou changed the title fix: support matching multiple expected zoned with multiple actual local date/time values Support matching multiple expected zoned with multiple actual local date/time values Mar 28, 2024
@papiomytoglou papiomytoglou changed the title Support matching multiple expected zoned with multiple actual local date/time values Add missing support for matching multiple expected zoned date/time values with multiple actual local ones Apr 6, 2024
@papiomytoglou papiomytoglou changed the title Add missing support for matching multiple expected zoned date/time values with multiple actual local ones Fix matching multiple expected zoned date/time values with multiple actual local ones May 18, 2024
@papiomytoglou papiomytoglou changed the title Fix matching multiple expected zoned date/time values with multiple actual local ones Fix matching of multiple expected zoned date/time values with multiple actual local ones May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant