I am trying to test my spring boot application by using junit5 and mockMvc, however i cannot even compile it because java cannot resolve the symbol param. Can anyone please tell me what i can do to find the missing package?
I am using IDEA to do the development. I think i need to import some package of mockMvc, however i cannot figure out which one i have missed.
@ExtendWith(SpringExtension.class)
@SpringBootTest
@AutoConfigureMockMvc
public class EmployeeServiceTest {
@Autowired
private MockMvc mockMvc;
@Autowired
private ObjectMapper objectMapper;
@Autowired
EmployeeRepository employeeRepository;
@Test
void testInsert() throws Exception{
mockMvc.perform(post("/add"))
.param("id", 999)
.andExpect(status().isOk());
ArrayList<Employee> tmpList = (ArrayList<Employee>)employeeRepository.findEmp(999);
}