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

179 views Asked by At

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

1

There are 1 answers

0
Yaniv K. On BEST ANSWER

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