mercredi 3 juin 2015

Creating javax.ws.rs.core.HttpHeaders instance for unit test

I have created a REST service which takes HttpHeaders as an input argument as given below:

@Service
public class MyTestService {

   public Response addService(javax.ws.rs.core.HttpHeaders headers, String jsonToAdd) {
      //verify/process headers and return response
   }
}

Now, I want to write UnitTest for this service and for that I need to create dummy HttpHeaders instance to pass as an argument for this addService. I am not able to figure out how to create instance on HttpHeaders? Is there any way I can mock this HttpHeaders and set header params there?

Aucun commentaire:

Enregistrer un commentaire