How To Send a Complex Object to a Rest Web Service?

What is a good way to test Java web service client code?

  • I have some Java web service client code (REST and JSON) using Apache HttpClient. I want to test that it is sending the correct requests. I already have unit tests that check the logic before I send it out. On top of that, I would like to test the HTTP requests itself. Unfortunately, Apache HttpClient doesn't provide a mock serverĀ  which I can test. What is a good tool to use? I am using embedded Jetty insideĀ  JUnit tests, but found some limitations, as I described in this question:

  • Answer:

    If you are looking for mocking your REST services, https://github.com/mkotsur/restito could be a good option.

Aneesh Nair at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.