Refactor
Added unit test and integration test for the example.
@willedwards Thanks for the PR. I appreciate the effort, however I choose to not make any changes to the project.
This sample project was developed together with an accompanying blog post and it does not make sense to brush up one without the other. That said, today both are getting outdated. The project was implemented using Spring Boot version 1.1.6, i.e. Spring version 4.0.7, and there has been welcome additions to the Spring async story since then. For example, as of release Spring 4.1 it is possible to return ListenableFuture directly from a controller method, which means that the conversion to DeferredResult in the async() method in the controller is redundant. There will be even more changes this autumn when Spring 5.0 will be released with native support for reactive programming (1, 2), including reactive @Controller methods that are likely to prompt even bigger modifications. For this reason, I choose to leave both the project and the blog post in their current states as a document of how things were for not so long ago.