modules/ballerina-native/src/test/java/org/ballerinalang/nativeimpl/functions/JSONTest.java
@Test(description = "Add a string to a valid json object")
    public void testAddStringToObject() {
        BValue[] args = {new BJSON(json1), new BString("$.name"), new BString("nickName"),
                new BString("Paul")};
        BValue[] returns = BLangFunctions.invoke(bLangProgram, "addStringToObject", args);

        final String expected = "{\"name\":{\"fname\":\"Jack\",\"lname\":\"Taylor\",\"nickName\":\"Paul\"}," +
                "\"state\":\"CA\",\"age\":20}";
        Assert.assertEquals(getJsonAsString(returns[0]), expected);
    }
/*
     * Test Add-to-object Functions
     */
Test Add-to-object Functions
Test Add - to - object Functions
@Test(description = "Add a string to a valid json object")
    public void testAddStringToObject() {
        BValue[] args = {new BJSON(json1), new BString("$.name"), new BString("nickName"),
                new BString("Paul")};
        BValue[] returns = BLangFunctions.invoke(bLangProgram, "addStringToObject", args);
        final String expected = "{\"name\":{\"fname\":\"Jack\",\"lname\":\"Taylor\",\"nickName\":\"Paul\"}," +
                "\"state\":\"CA\",\"age\":20}";
        Assert.assertEquals(getJsonAsString(returns[0]), expected);
    }
@ Test ( description = "Add a string to a valid json object" ) public void testAddStringToObject ( ) { BValue [ ] args = { new BJSON ( json1 ) , new BString ( "$.name" ) , new BString ( "nickName" ) , new BString ( "Paul" ) } ; BValue [ ] returns = BLangFunctions . invoke ( bLangProgram , "addStringToObject" , args ) ; final String expected = "{\"name\":{\"fname\":\"Jack\",\"lname\":\"Taylor\",\"nickName\":\"Paul\"}," + "\"state\":\"CA\",\"age\":20}" ; Assert . assertEquals ( getJsonAsString ( returns [ 0 ] ) , expected ) ; }
Test Add-to-object Functions
Test Add - to - object Functions