public Object bodyPath(String path) {
        Object body = LOCAL_REQUEST.get().getBodyConverted();
        if (body == null) {
            return null;
        }
        if (path.startsWith("/")) {
            Variable v = ScenarioEngine.evalXmlPath(new Variable(body), path);
            if (v.isNotPresent()) {
                return null;
            } else {
                return JsValue.fromJava(v.getValue());
            }
        } else {
            Json json = Json.of(body);
            Object result;
            try {
                result = json.get(path);
            } catch (Exception e) {
                return null;
            }
            return JsValue.fromJava(result);
        }
    }
@Test
    void testBodyPath() {
        background().scenario(
                "pathMatches('/hello') && bodyPath('$.foo') == 'bar'",
                "def response = { success: true }"
        );
        request.path("/hello").bodyJson("{ foo: 'bar' }");
        handle();
        match(response.getBodyConverted(), "{ success: true }");
    }