I have implemented a REST API in java and using Jersey Test framework for unit testing the REST API. The REST implementation reads the data from an input JSON file and based on information from the input file it returns JSON response depending on the end point. The implementation is working fine and I can manually verify it. I want to test the same using Jersey framework. So I initially configure the Jersey test as below.
@Override
protected Application configure(){
return new ResourceConfig(REST.class);
}
Problem is how do I read the data from input file for testing? I could use Mockito to mock the objects but as there are more endpoints, it wouldn't be a feasible way.
Is there a way I can read an input file using Jersey test framework?
Aucun commentaire:
Enregistrer un commentaire