當我的代碼是這樣的時會出現錯誤:@Testpublic void getTemplateByIdTest() throws Exception { client.get().uri("/template/getTemplate/7") .exchange() .expectStatus().isOk() .expectHeader().contentType(MediaType.APPLICATION_JSON_UTF8) .expectBody(VtTemplateVO.class) .returnResult();}當我像這樣更改我的代碼時,就可以了!@Testpublic void getTemplateByIdTest() throws Exception { client.get().uri("/template/getTemplate/7") .exchange() .expectStatus().isOk() .expectHeader().contentType(MediaType.APPLICATION_JSON_UTF8) .expectBody(String.class) .returnResult();}為什么我用的.expectBody(VtTemplateVO.class)時候會說org.springframework.web.reactive.function.UnsupportedMediaTypeException: Content type 'application/json;charset=UTF-8' not supported有人知道嗎?請幫忙,謝謝
添加回答
舉報
0/150
提交
取消