当我的代码是这样的时会出现错误:@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
提交
取消