Your assertion is wrong. You are using Tiles
and as such that ViewResolver
is also consulted, remember you are basically doing an integration test NOT a unit test. You are testing the whole chain of components working together.
You need to either switch the ViewResovler
for your test, basically rendering your test less valuable as you are not testing the actual configuration, or find another validating the response. (You might need the content and check the title for instance).
mockMvc.perform(get("/manageEntities.html"))
.andExpect(status().isOk())
.andExpect(content().source(containsString("Manage Entities"));
Basically the above checks the resulting page, to contain the given String. (From the top of my head so might require some tweaking).
More information