Skip to content

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

Open
@rajacksjr

Description

@rajacksjr

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions