I have a web application that requires Login. Upon login success, many session attributes are loaded, which will be needed by subsequent navigation of other web pages.
This is the code I login with user name and password using MockMVC
How do I chain a second page visit action after the login page visit? Something like:
mockMvc.perform(post("/login").session(session).param("username", "Jack").param("password","Jack'sPassword"))
.perform(get("/anotherPage")).andExpect(/*some session attribute are successfully loaded*/)
Aucun commentaire:
Enregistrer un commentaire