dimanche 13 avril 2014

Spring MockMvc Passing Nested Form Parameters


Vote count:

0




I have the following form



public class MyForm {
private Account account;
}

public class Account {
private String firstName;
}


How do I pass firstName parameter? (The following approach does not work)



mockMvc.perform(post("/xyz")
.param("account.firstName", "John"))
.andExpect(model().hasErrors())
.andExpect(view().name("/xyz"))
.andExpect(status().isOk())


asked 21 secs ago

led

18





Aucun commentaire:

Enregistrer un commentaire