Folks,

I am trying (without much success) to write a unit test against a CXF service. 
Note that by Unit Test, I mean no starting up a "dummy" web server, no network 
access, etc. I will be using mocks for these parts.

Essentially what I want to do is this:

1) Set up a JSON request, for simplicity:

{ "userId":1 }

2) Invoke the CXF service with that request to:
        
/services/getUser

During this step, i'll be injecting mocks into the service, so it will always 
return "Joe Schmoe"


3) Assert that the response comes back in the JSON format of:

{ getUserResponse: { "firstName":"Joe", "lastName":"Schmoe" } }


My problem is that outside of a deployed/running web instance, i'm not sure how 
to get step 2 to take in JSON and return JSON.

Suggestions?

---
Nayan Hajratwala
http://agileshrugged.com
http://twitter.com/nhajratw
734.658.6032

Reply via email to