Read online Json file

We asked over 12000 families what Trek bicycles they have in their garage. The responses were captured at https://trekhiringassignments.blob.core.windows.net/interview/bikes.json. Instructions Write an application in Java that uses the captured response data to tell us what the 20 most popular responses are. Your application should display the top 20 most popular responses (combinations of bikes) and…

Getting error in converting Json response to java object while writing test cases

I am working with an api and using Gson to convert Json response into java object. The code is working fine and I am getting the required results, but when I am writing test cases I am getting a ClassCastException. GET Call: String jsonResponse = getData(parameter1,parameter2);//api call if(!StringUtils.equalsIgnoreCase(jsonResponse, “null”)) {`JSONObject jsonObject = new JSONObject(jsonResponse);` Gson…

How can i get all “url” elements from the given json

When i execute this Statement in my DB2 instance i get an empty column named url. But i except 2 rows in my column. Why isn’t it working and how can i fix it? select t.url from JSON_TABLE(‘ [{“id”: “286”, “url”: “https://25.media.tumblr.com/tumblr_lh3j390T241qfyzelo1_250.jpg”}, {“id”: “2dd”, “url”: “https://24.media.tumblr.com/hA6zECTlEg4sfljwHQf5jm4So1_250.jpg”} ]’,’$[*]’ columns (url varchar(100) PATH ‘$.url’) ) as t;