lundi 21 décembre 2020

How to create an object for testing from external library

I have a class for parsing a json response given from an API request, that was made using the restlet framework.

The method responsible for reading the json takes an object from this framework, a Representation, public QueryResponse readResponse(Representation repr), and I would like to test the functionality of this

My question is, how do I pass a valid Representation object into this method in my JUnit test, considering I do not know how it is constructed from the API call, will I have to implement the call itself within the test to retrieve a workable object or is there another method?

Aucun commentaire:

Enregistrer un commentaire