'Spring Boot context-path doesn't return index.html in tests

I want to test that GET "/" returns index.html (Which is the case in a build) but when I try that in an integration test I get 404 NOT FOUND. Here's how I test:

mvc.perform(get("/"));

application.properties:

server.servlet.context-path=/

Again, this works as expected with a browser/REST client.

Thanks



Solution 1:[1]

Although it makes no sense to me, the problem was the accept type - application/json. Changed it to / and it worked

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Yaniv K.