I have a problem when I want to sending data using byte format in UDP protocol, the problem is when I try to create a data with type json object, I can\'t get the byte format of
Use utility class from ObjectMapper
of jackson-databind
project, ie objectMapper.writeValueAsBytes(dto)
returns byte[]
@Autowired
private ObjectMapper objectMapper;
ContractFilterDTO filter = new ContractFilterDTO();
mockMvc.perform(post("/api/customer/{ico}", "44077866")
.contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)
.content(objectMapper.writeValueAsBytes(filter)))...
Maven dependency:
com.fasterxml.jackson.core
jackson-databind
2.8.8.1