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

add user-api test #1456

Merged
merged 10 commits into from
Jun 1, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,20 @@ public void testDelete() {

protected void createUser(String name) {
String user = "{\"user_name\":\"" + name + "\",\"user_password\":\"p1" +
"\", \"user_email\":\"user1@baidu.com\", " +
"\"user_phone\"123456789\", \"user_avatar\":\"image1" +
"\", \"user_email\":\"user1@baidu.com\"," +
"\"user_phone\":123456789,\"user_avatar\":\"image1" +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep string

".jpg\"}";
this.client().post(path, user);
Response r = this.client().post(path, user);
assertResponseStatus(201, r);
}

protected List<Map<String, Object>> listUsers() {
Response r = this.client().get(path, ImmutableMap.of("limit",
NO_LIMIT));
String result = assertResponseStatus(200, r);
Map<String, List<Map<String, Object>>> resultMap =
JsonUtil.fromJson(result, new TypeReference<Map<String,
List<Map<String, Object>>>>() {});
JsonUtil.fromJson(result, new TypeReference<Map<String,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

improve align

List<Map<String, Object>>>>() {});
return resultMap.get("users");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JsonUtil.fromJson().get("users");

}
}