@Test public void shouldLoadListOfJavaObjectsFromJsonString() { JsonHelper<TestModel> jsonHelper = new JsonHelper<>(TestModel[].class); List<TestModel> testModels = jsonHelper.loadListFromString("[" + "{\"testName\":\"hello\"}, " + "{\"testName\":\"world\"}" + "]"); assertThat(testModels.size(), equalTo(2)); assertThat(testModels.get(0).getTestName(), equalTo("hello")); assertThat(testModels.get(1).getTestName(), equalTo("world")); }
public List<T> loadListFromString(String jsonRules) { return loadFromReader(new StringReader(jsonRules)); }
JsonHelper { public List<T> loadListFromString(String jsonRules) { return loadFromReader(new StringReader(jsonRules)); } }
JsonHelper { public List<T> loadListFromString(String jsonRules) { return loadFromReader(new StringReader(jsonRules)); } JsonHelper(Class clazz); }
JsonHelper { public List<T> loadListFromString(String jsonRules) { return loadFromReader(new StringReader(jsonRules)); } JsonHelper(Class clazz); List<T> loadListFromFile(File file); List<T> loadFromReader(Reader reader); List<T> loadListFromString(String jsonRules); }
JsonHelper { public List<T> loadListFromString(String jsonRules) { return loadFromReader(new StringReader(jsonRules)); } JsonHelper(Class clazz); List<T> loadListFromFile(File file); List<T> loadFromReader(Reader reader); List<T> loadListFromString(String jsonRules);  }