@Test
public void readSimpleList() throws Exception {

    JSONArray mockJsonArray = mock(JSONArray.class);
    when(mockJsonArray.length()).thenReturn(1);
    when(mockJsonArray.get(0)).thenReturn("dummyResult");
    JSONTokener mockJsonTokener = mock(JSONTokener.class);
    when(mockJsonTokener.nextValue()).thenReturn(mockJsonArray);
    when(mockJsonObjectManager.newTokener(anyString())).thenReturn(mockJsonTokener);
    // This string doesn't matter, but it's what we mimic with the mocks.
    String listResponse = "[\"dummyResult\"]";
    StringReader reader = new StringReader(listResponse);
    Map<String, Object> map = handler.readJson(reader);
    assertNotNull(map);
    assertEquals(1, map.size());
    // Validate that the raw JSON Array was wrapped in the fake root object. This behavior
    // should change as soon as we can release a major version update to not do this dance.
    assertTrue(map.containsKey(KeenConstants.KEEN_FAKE_JSON_ROOT));
    Object jsonArrayObj = map.get(KeenConstants.KEEN_FAKE_JSON_ROOT);
    assertNotNull(jsonArrayObj);
    assertTrue(jsonArrayObj instanceof List);
    assertEquals(1, ((List)jsonArrayObj).size());
    assertEquals("dummyResult", ((List)jsonArrayObj).get(0));
}