@Test
public void testCastStringToJson() {

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