Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hxkdidi opened this issue Jul 17, 2018 · 3 comments
Open

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

hxkdidi opened this issue Jul 17, 2018 · 3 comments

Comments

@hxkdidi
Copy link

hxkdidi commented Jul 17, 2018

@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"));
}

@hxkdidi
Copy link
Author

hxkdidi commented Jul 17, 2018

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

@SPRAL
Copy link

SPRAL commented Oct 10, 2018

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

@SPRAL
Copy link

SPRAL commented Oct 14, 2018

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants