Code example for JsonObject

Methods: addProperty

0
        helper.addAdditionalScript(function.toString());
    } 
 
    @Test 
    public void testResult() { 
        JsonObject data = new JsonObject();
        data.addProperty("title", "My name is");
        data.addProperty("x", "Bond,");
        data.addProperty("y", "James Bond");
 
        String template = Utils.readFile("src/main/webapp/template/dot/dummy-template-6.html");
        TestResult result = helper.doTemplateAsResult(template, data);
        assertEquals("Test", result.content("h1"));
        assertEquals("Test Test", result.content(".a"));
        assertEquals("Test", result.content(".a a"));
    } 
} 
Experience pair programming with AI  Get Codota for Java