This tutorial explains how you can use MockRestServiceServer framework for testing RestTemplate calls.