I am writing a test for the REST API , I use restassured and jackson. I described the model of JSON responsions in the classes, but there is one thing but, since comes an array of objects

[{some objects}, {some objects}, .... {some objects}] 

then I accept it in List<Object> and here is the problem with deserialization,

 List<Country> countries = given().spec(spec) .expect() .statusCode(200) .when() .get("http://restcountries.eu/rest/v1/") .thenReturn().as(List.class); 

I deserialize the List.class class but it adds everything to LinkedHashMap enter image description here

I don't like to pull the values ​​out of countries and get to key / value

  • neither can you, such code does not work - Roman C
  • Tell me where to dig in this situation - Andrew

1 answer 1

Try

 .get("http://restcountries.eu/rest/v1/").as(Country[].class); 
  • Thank! Everything flew. - Andrew