title: How to test a RestClientException with MockRestServiceServer
body: <p>While testing a RestClient-Implementation I want to simulate a RestClientException that may be thrown by some RestTemplate-methods in that implementation f.e. the delete-method:
  </p>
  
  <pre><code>@Override
  public ResponseEntity&lt;MyResponseModel&gt; documentDelete(String id) {
      template.setErrorHandler(new MyResponseErrorHandler());
      ResponseEntity&lt;MyResponseModel&gt; response = null;
      try {
          String url = baseUrl + "/document/id/{id}";
          response = template.exchange(url, DELETE, null, MyResponseModel.class, id);
      } catch (RestClientException ex) {
          return handleException(ex);
      }
      return response;
  }
  </code></pre>
  
  <p>How can I achieve this?</p>
  
  <p>I define the mock-server in this way:</p>
  
  <pre><code>@Before
  public void setUp() {
      mockServer = MockRestServiceServer.createServer(template);
      client = new MyRestClient(template, serverUrl + ":" + serverPort);
  }
  </code></pre>