Yes, use Dtos. Here is a common practice example:
@Test
void PersonController_FindPersonById() throws Exception {
PersonDto personDto = new PersonDto(null, "John", "Doe", 28, null);
long personId = 1;
when(personService.getPersonById(personId)).thenReturn(personDto);
ResultActions response = mockMvc.perform(get("/person/1")
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(personDto))
);
response.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.jsonPath("$.firstname", CoreMatchers.is(personDto.firstname())))
.andExpect(MockMvcResultMatchers.jsonPath("$.lastname", CoreMatchers.is(personDto.lastname())))
}