liyifeng1994 / ssm

手把手教你整合最优雅SSM框架:SpringMVC + Spring + MyBatis

Home Page:http://blog.csdn.net/qq598535550/article/details/51703190

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

java.lang.AssertionError: Status expected:<200> but was:<406>

hxkdidi opened this issue · comments

@test
public void appointTest() throws Exception {
this.mockMvc.perform(post(appointUrl, bookId).param("studentId", "1").accept(MediaType.APPLICATION_JSON))
.andExpect(content().contentType("application/json;charset=utf-8"));
}

所有实体类增加get(),set()方法后就成功了

commented

我加了entity和dto,但是还是报这个错?

commented

我加了entity和dto,但是还是报这个错?

找到问题了,是jar包的问题,我写成jackson-core了,应该是jackson-Databind