@Test
@WithMockUser(username = TEST_USER, authorities = ADD_PERM)
public void testSave() throws Exception {

    Notice notice = new Notice();
    notice.setNumber("number");
    notice.setName("标题");
    notice.setContent("本人想离职");
    notice.setNoticeType(NoticeType.TOP_SCROLL);
    String content = objectMapper.writeValueAsString(notice);
    String result = mockMvc.perform(post("/sys/notice")
            .content(content) // @RequestBody 解析
            .contentType(MediaType.APPLICATION_JSON_UTF8) // @RequestBody 解
              .param("xxx", "xxx")// @RequestParam 解析
              .contentType(MediaType.APPLICATION_FORM_URLENCODED) // @RequestParam 解析
            .accept(MediaType.APPLICATION_JSON_UTF8)) // 响应类型
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.data.id").isNotEmpty())
            .andReturn().getResponse().getContentAsString();
    log.info("{}", result);
}