1
我有以下測試用例,我想發佈一塊json數據,但現在我得到了404,我在這裏做錯了什麼?WSRequest POST FunctionalTest中的JSON對象最終會得到404
@Test
public void testIndex() {
User user = new User("[email protected]", "secret", "test", "(111)111-1111");
Gson gson = new Gson();
String postJson = gson.toJson(user);
// post to add the new user
WSRequest postRequest = WS.url("http://localhost:9001/user/add");
postRequest.body = postJson;
HttpResponse postResponse = postRequest.post();
assertEquals(postResponse.getStatus(), (Integer)200);
}