org.springframework.boot spring-boot-starter-parent 2.4.4

I created a new method in a RestController and Adnotated it with @GetMapping(value = "someValue", consumes = MediaType.APPLICATION_JSON_VALUE). The rest is irrelevant.

I also created an integration test for the method and used @MockMvc to test that the method was called for the path "someValue".

That fact is that the integration test worked like a charm so I didn't test to see if running the application and accessing the "someValue" path would worked, I believed the integration test.

What happened is that in local environment or any other environment, the Controller didn't pick up the path and so it breaked the flow of the application.

The problem: "consumes = MediaType.APPLICATION_JSON_VALUE".

The solution: delete "consumes = MediaType.APPLICATION_JSON_VALUE".

Expected behaviour: The integration test should have failed!

Comment From: bclozel

Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use the issue tracker only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.

In this case, the parts that you mention as irrevelant are probably explaining the behavior you're seeing. A question on StakOverflow showing both the controller and the integration test is likely to get you further.