Junior — Middle
Quale tipo di dato restituisce il metodo get della classe JsonPath in Rest Assured?
sobes.tech AI
Risposta dell'AI
Il metodo get della classe JsonPath in Rest Assured restituisce un oggetto di tipo Object, che può essere convertito nel tipo necessario a seconda della struttura JSON e dei dati attesi. Di solito può essere String, Integer, List, Map, ecc. Ad esempio, se il percorso indica un valore di stringa — verrà restituito un String; se indica un array — un List.
Esempio di utilizzo:
String name = jsonPath.get("user.name");
List<String> items = jsonPath.getList("items");