 <p>The hint to a solution is here <a href="https://github.com/spring-projects/spring-hateoas/issues/155#issuecomment-36487869" rel="nofollow">https://github.com/spring-projects/spring-hateoas/issues/155#issuecomment-36487869</a></p> <blockquote> <p>The way the method-to-link functionality works is by creating a proxy for the return type of the method to be able to inspect the previous invocation. As String is a final class it cannot be proxied by definition.</p> </blockquote> <p>Checked the method signature:</p> <pre><code>@RequestMapping(value = "/topology/{environmentId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public String environmentTopology(@PathVariable("environmentId") String environmentId, ... </code></pre> <p>Since it returns a String, you need to wrap it in a class that is proxy-able, like <code>ResponseEntity</code></p> <pre><code>@RequestMapping(value = "/topology/{environmentId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public ResponseEntity&lt;String&gt; environmentTopology(@PathVariable("environmentId") String environmentId, </code></pre> <p>The <code>ResponseEntity</code> wraps your <code>String</code> response allowing the test mechanism to work.</p>