spring-framework icon indicating copy to clipboard operation
spring-framework copied to clipboard

MockMvcWebConnection doesn't work with async results [SPR-14442]

Open spring-projects-issues opened this issue 9 years ago • 1 comments

Chris DaMour opened SPR-14442 and commented

MockMvcWebConnection calls MockMVC.perform().andReturn().getResponse() but that doesn't work if you are doign async in your controllers, like returning a deferredResult or Single<HttpEntity> etc (probably CompletableFuture as well).

The mockmvc syntax for achieving a result is a bit clunky requiring two calls to perform()..maybe it could be made simpler there

also HtmlUnitRequestBuilder doesn't set async support to true


Affects: 4.3.1

spring-projects-issues avatar Jul 08 '16 05:07 spring-projects-issues

Rossen Stoyanchev commented

Indeed the HTML Unit integration for Spring MVC Test doesn't support async requests currently. We'll have to revisit that for 5.0.

spring-projects-issues avatar Jul 12 '16 21:07 spring-projects-issues