@Test
public void testCastJsonToString() {

    ScenarioContext ctx = getContext();
    Script.assign("myJson", "{ root: { foo: 'bar' } }", ctx);
    Script.assign(AssignType.STRING, "myString", "myJson", ctx, true);
    ScriptValue value = ctx.vars.get("myString");
    assertEquals(ScriptValue.Type.STRING, value.getType());
    assertEquals("{\"root\":{\"foo\":\"bar\"}}", value.getAsString());
}