I am able to read a csv file and convert it to json by
def expectedResponse = read('classpath:somefile.csv')
Suppose I have csv file as below
name,age
praveen,29
joseph,20
1.It is converting all elements as string and stores in the variable as json. How to keep the number as a number ? because it causes match failure which i do later with the actual response.
2.How to get the value 20. Like by specifying joseph, I want to get the age. I got the jsonpath as
get expectedResponse $.[?(@.member == '<name>')].age
I get the name from examples. So I get it as joseph in runtime. But i get error as reason: not equal (Integer : JSONArray). It is not returning the age alone (Integer value)
Or is there any better way to get it ?