Skip to content
Advertisement

Wiremock stubbing error: “Unrecognized field “timestamp” (class com.github.tomakehurst.wiremock.common.Errors), not marked as ignorable”

here I come because I have not found any solution to my problem. I’m actually trying to stub a response with wiremock (that call to the Mocked service is be done via FeignClient). My intention is to get a fake response with the real feign client, not in a test, but in the real application. Therefore, In this case, I’m not stubbing the WireMockServer in a test, but in the spring boot application class, however when stubbing there the response I’m having a super weird error that I have investigated a lot so far without success.

Here is the code I’m using so far:

JavaScript

This is actually failing in the stubFor( mappingBuilder ); line, and this is the exception I got:

JavaScript

So one question would be, does wiremock only work in testing?

I have tried changing the JSON, and its fields but that does not seem to work, so if any of you know whow to solve that issue would be helpful, or if you also know how to stub an api request that is called by @FeignClient (not in a test but in the real spring application run) as an alternative maybe could work too.

Thank you!.

Advertisement

Answer

Right after server.start() you need:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement