346812 (1) [Avatar] Offline
#1
Hi, in this code:

mockMvc.perform(get("/spittles"))
.andExpect(view().name("spittles"))
.andExpect(model().attributeExists("spittleList"))
.andExpect(model().attribute("spittleList",
hasItems(expectedSpittles.toArray())));


The test passes even if I've only written the SpittleController and the SpittleRepository interface. How does the view name "spittles" and attribute "spittleList" get created?

If I set them to different value, the test fails. So somewhere in this line of code, these objects with those default names get created. Can someone shed light on this?

Thanks.