0

I am exploring playwright for automating api tests and I am unable to deserialise APIResponse of playwright to a POJO using java. I used to do this with rest assured using following code:

        PetStoreModel petStoreModel =  response.as(PetStoreModel.class);
Bilal
  • 558
  • 8
  • 18

1 Answers1

0

I managed to do this with the help of ObjectMapper.

APIResponse response = getPetStoreResponse();
ObjectMapper objectMapper = new ObjectMapper();
PetStoreModel petStoreModel = objectMapper.readValue(response.text(),PetModel.class);
Bilal
  • 558
  • 8
  • 18