提取json中字段值:
提取json子项中accessToken值:JSONObject json = new JSONObject(result);String accessToken = json.getJSONObject("result").getString("accessToken");
提取json父项中state值:Boolean state = json.getBoolean("state");
对比结果:Sting类型比较:Assert.assertEquals("true",result);Boolean类型比较:Boolean.TRUE.equals(result); Boolean.compare(x,y) == 1;
页:
[1]