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

JSON comparison does not work with JsonUnit 3.0.0 and higher #1813

Open
azotcsit opened this issue Nov 16, 2023 · 0 comments
Open

JSON comparison does not work with JsonUnit 3.0.0 and higher #1813

azotcsit opened this issue Nov 16, 2023 · 0 comments

Comments

@azotcsit
Copy link

azotcsit commented Nov 16, 2023

Describe the issue
MockServer JSON body matching does not work when JsonUnit 3.0.0 and higher is in use. Basically, request matching fails with the following error:

java.lang.NoClassDefFoundError: net/javacrumbs/jsonunit/core/internal/Options

After a small digging, I found out that there was a refactoring made in JsonUnit (lukas-krecan/JsonUnit#634) as a part of which Options class had been moved to another package (which is mentioned on their release notes: https://github.com/lukas-krecan/JsonUnit#300-2023-07-05). Therefore, MockServer is not anymore compatible with JsonUnit 3.0.0+.

Unfortunately, https://mvnrepository.com/artifact/org.mock-server/mockserver-core/5.15.0 suggests that MockServer is compatible with JsonUnit 3.2.2 which is not true.

What you are trying to do
I'm just trying to check/match JSON requests sent from a Spring application.

MockServer version
5.15.0

To Reproduce
Steps to reproduce the issue:

  1. Use JsonUnit 3.0.0 and higher (I use 3.2.2 version)
  2. Run MockServer from a JUnit test
  3. Create an expectation with a JSON body
  4. Send a request with the same JSON body (it will not match)

Expected behaviour
Request with the same JSON body matches

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

No branches or pull requests

1 participant