unit testing - spring mvc controller Test with Enumeration value -
I'm trying to test this method:
@RequestMapping (value = "/ Prsonlstet / {employee} ED" method = Anurodmthkput) public @ Risponsbodi object (update @ Pathwarwybl integer Mpariaidi, @ Rajstperam Mployrstet Impestet) throws exception (staff services). Offshore Employee (Entity Manager.Fund (Employee Employee, Employee), Imprest); Return tap; } EmplyeeState are saved in the DB as an enumeration, integer values, it is my test code:
@Test public void EmployeeTest () throws exception {mockMvc.perform (MockMvcRequestBuilders.put ( "/ PersonalState / {empstate}", EmplyeeState.PERMANENT) ultimate ( "EmployeeID", "550")) .andDo (print ()) .andExpect (MockMvcResultMatchers.status () .Okay()); } I found this errror:
resolve exception: Type = org.springframework.beans.TypeMismatchException MockHttpServletResponse: level = 400 I tried to pass two variables as parameters, was only passed as employee ID parameter, but I still have the same error also param parameter should be both string. any idea?
The problem is solved I passed the value as enum string value.
Comments
Post a Comment