/** * Get the result of an Object path expression as a boolean. * * @param path The Object path. * @return The object matching the Object path. This may be any primitive type, a List or a Map. A {@link java.lang.ClassCastException} will be thrown if the object * cannot be casted to the expected type. */ public <T> T get(String path) { final JSONAssertion jsonAssertion = createJsonAssertion(path, params); final Object json = jsonParser.parseWith(createConfigurableJsonSlurper()); return (T) jsonAssertion.getResult(json, null); }
public <T> T getJsonObject(String path) { final JSONAssertion jsonAssertion = createJsonAssertion(path, params); final Object json = jsonParser.parseWith(createConfigurableJsonSlurper()); return (T) jsonAssertion.getAsJsonObject(json); }
private String toJsonString() { final Object json = jsonParser.parseWith(createConfigurableJsonSlurper()); final String jsonString; if (json instanceof Map) { jsonString = JsonOutput.toJson((Map) json); } else { jsonString = JsonOutput.toJson(json); } return jsonString; }
public <T> T getJsonObject(String path) { final JSONAssertion jsonAssertion = createJsonAssertion(path, params); final Object json = jsonParser.parseWith(createConfigurableJsonSlurper()); return (T) jsonAssertion.getAsJsonObject(json); }
/** * Get the result of an Object path expression as a boolean. * * @param path The Object path. * @return The object matching the Object path. This may be any primitive type, a List or a Map. A {@link java.lang.ClassCastException} will be thrown if the object * cannot be casted to the expected type. */ public <T> T get(String path) { final JSONAssertion jsonAssertion = createJsonAssertion(path, params); final Object json = jsonParser.parseWith(createConfigurableJsonSlurper()); return (T) jsonAssertion.getResult(json, null); }
private String toJsonString() { final Object json = jsonParser.parseWith(createConfigurableJsonSlurper()); final String jsonString; if (json instanceof Map) { jsonString = JsonOutput.toJson((Map) json); } else { jsonString = JsonOutput.toJson(json); } return jsonString; }
public <T> T getJsonObject(String path) { final JSONAssertion jsonAssertion = createJsonAssertion(path, params); final Object json = jsonParser.parseWith(createConfigurableJsonSlurper()); return (T) jsonAssertion.getAsJsonObject(json); }
private String toJsonString() { final Object json = jsonParser.parseWith(createConfigurableJsonSlurper()); final String jsonString; if (json instanceof Map) { jsonString = JsonOutput.toJson((Map) json); } else { jsonString = JsonOutput.toJson(json); } return jsonString; }
/** * Get the result of an Object path expression as a boolean. * * @param path The Object path. * @return The object matching the Object path. This may be any primitive type, a List or a Map. A {@link java.lang.ClassCastException} will be thrown if the object * cannot be casted to the expected type. */ public <T> T get(String path) { final JSONAssertion jsonAssertion = createJsonAssertion(path, params); final Object json = jsonParser.parseWith(createConfigurableJsonSlurper()); return (T) jsonAssertion.getResult(json, null); }