@Test(expected = JSONException.class) public void testList_missingParameters() { String jsonResponse = JsonLoader.loadJson(DomainHelper.getRestUrlV1() + "/content/allophone/list"); logger.info("jsonResponse: " + jsonResponse); JSONObject jsonObject = new JSONObject(jsonResponse); }
@Test public void testList_success() { String jsonResponse = JsonLoader.loadJson( DomainHelper.getRestUrlV1() + "/content/allophone/list" + "?deviceId=abc123" + "&locale=" + Locale.EN); logger.info("jsonResponse: " + jsonResponse); JSONObject jsonObject = new JSONObject(jsonResponse); assertThat(jsonObject.has("result"), is(true)); assertThat(jsonObject.get("result"), is("success")); assertThat(jsonObject.has("allophones"), is(true)); }