title: how to write unit tests for REST web services developed using apache-cxf with spring without using Maven
body: <p>I have developed a REST web application using apache cxf library. I am able to access them using a browser and test. I want to write unit tests for the services. </p>
  
  <p>I tried testing it using embedded Jetty server with cxf. 
  After starting the Jetty server, I am getting a proxy using WebClient API of cxf. The relevant code is </p>
  
  <p><code>WebClient client = WebClient.create(ENDPOINT_ADDRESS);<br>
   client.accept("text/xml");<br>
  client.path("/studyservice/topimstudydetails");<br>
  client.replaceQuery("pnlId=3&amp;lclId=30&amp;indId=442&amp;maxImStudies=99&amp;rName=DEV");
  TopIMStudyDetailsResponse resp = client.get(TopIMStudyDetailsResponse.class);
  assertEquals(resp.getStatus().getReturnCode(),0);</code></p>
  
  <p>The call to the service is successful as I can see the logs, but I'm get a null pointer where the service is trying to make a dao call. The dao is declared as a dependency for the service. How can we get a proxy with all the dependencies injected ? </p>