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

NoSuchMethod Error: java.lang.Object com.githum.tomakehurst.wiremock.common,Exceptions.uncheck(java.util.Callable, java.lang.Class) #123

Open
rajacksjr opened this issue Nov 13, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@rajacksjr
Copy link

rajacksjr commented Nov 13, 2024

Proposal

I have implemented a unit test to test out my GRPC application. I am building my project using Maven, and am using version 3.9.2 of the wiremock-standalone and version 0.8.1 of the wiremock-grpc-extension libraries. The error is occurring in the 'public String toJson(MessageOrBuilder message)method in the JsonMessageConverter class of the wiremock-grpc-extensions library, line 35. ThetoJsonmethod is calling thepublic static uncheck(Callable work, Class returnType)' method as follows.

  • return Exceptions.uncheck(() -> jsonPrinter.print(message), String.class)

I did notice that the public <T extends Message, B extends Message.Builder> T toMessage(String json, B builder) method in the JsonMessageConverter class is using the @SuppressWarnings("unchecked") annotation. Should the 'public String toJson(MessageOrBuilder message)` method be doing the same thing?

Reproduction steps

To reproduce the problem, create a unit test that generates a response message using a com.google.protobuf.MessageOrBuilder class object instead of building a response message via JSON.

References

No response

@rajacksjr rajacksjr added the bug Something isn't working label Nov 13, 2024
@tomakehurst
Copy link
Member

Hey, please could you retest this with the latest release of the extension (0.9.0)?

@rajacksjr
Copy link
Author

rajacksjr commented Jan 3, 2025

What would cause the following error?

`Request was not matched

[equalToJson] |
{ |
"base" : 50.0, | !@@!%@#%#^^ <<<<< Body does not match
"height" : 20.0 |
} |`

@rajacksjr
Copy link
Author

Hey, please could you retest this with the latest release of the extension (0.9.0)?

I updated to the latest release. However, I am now getting the following error.

Request was not matched [equalToJson] | { | "base" : 50.0, | !@@!%@#%#^^ <<<<< Body does not match "height" : 20.0 | } |

How do I resolve this error?

@leeturner
Copy link
Collaborator

I don't suppose you could put a small project together that demonstraites the problem could you? It will really help us diagnose the issue

@rajacksjr
Copy link
Author

Has anyone had this problem before?

@leeturner
Copy link
Collaborator

Not to my knowledge. I think you are the first to report it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants