Code example for JsonParser

Methods: parse

0
    public void setup() throws IOException { 
        File jsonFile = new File("json/bloginfo.json");
        FileReader fr;
        fr = new FileReader(jsonFile);
        BufferedReader br = new BufferedReader(fr);
        JsonParser parser = new JsonParser();
        JsonElement jelement = parser.parse(br);
        response =  new Response(jelement);
        br.close();
        fr.close();
         
    } 
    @Test 
    public void blog() { 
        Blog blog = response.getBlog();
        assertEquals("David's Log", blog.getTitle());
        assertEquals("david", blog.getName());
    } 
 
} 
Contextual code suggestions in your IDE  Get Codota for Java