MockRestServiceServer is a framework for unit testing RestTemplate based code. It is a part of the spring project and used to mock out REST calls to an actual REST service. It takes the approach of mocking the server and allowing you to specify expected behavior and responses in your junit test class. It also handles server exception classes.
You can read about this framework on my blog : http://waheedtechblog.blogspot.in/2013/10/testing-rest-client-using.html
Other References : http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/testing.html#spring-mvc-test-client https://github.com/SpringSource/spring-test-mvc