嘿,我是新手,请放心,设法让 POST 路由测试用例工作,下面的测试用例的响应主体是
public void submissionsUserPostTest() {
JSONObject data = new JSONObject();
data.put("username", "XYZ");
String jsonString = data.toJSONString();
Response request = given().contentType("application/json")
.body(jsonString).expect().statusCode(201).when()
.post(postRoute);
request.print();
}
身体
{"createdAt":"2014-04-16T20:04:40.560Z","updatedAt":"2014-04-16T20:04:40.560Z","id":"51de8ae0-","_links":{"self":{"href":"/assignments/51de8ae0-c43e-44c3-b46d-f48a25739385"}},"username":"XYZ","uploadDate":"2014-04-16T20:04:40.560Z"}
所以我的问题是如何使用 POST 路由生成的 id 到我的 GET 路由 /assignments/{id} 使用请求?