- assertEquals(id + ",true," + u.getPreferredName().toAbbreviatedString() + "\n" + u2 + ",false," + User.getById(u2).getPreferredName().toAbbreviatedString() + "\n", res);
+ assertEquals(new JSONArray().toString(), new JSONArray(new JSONTokener(res)).toString());
+ grant(u, Group.LOCATE_AGENT);
+ grant(User.getById(u2), Group.LOCATE_AGENT);
+ res = IOUtils.readURL(doApi(FindAgent.PATH_INFO, "id=" + id + "&id=" + u2)).replace("\r", "");
+ JSONTokener jt = new JSONTokener(res);
+ JSONObject j1 = new JSONObject();
+ j1.put("id", id);
+ j1.put("canAssure", true);
+ j1.put("name", u.getPreferredName().toAbbreviatedString());
+ JSONObject j2 = new JSONObject();
+ j2.put("id", u2);
+ j2.put("canAssure", false);
+ j2.put("name", User.getById(u2).getPreferredName().toAbbreviatedString());
+ JSONArray ja = new JSONArray(Arrays.asList(j1, j2));
+ assertEquals(ja.toString(), new JSONArray(jt).toString());