Work around MockMvc bug (SPR-13079) that has only been fixed in 4.2

See gh-4098
This commit is contained in:
Andy Wilkinson 2015-10-06 11:23:19 +01:00
parent b8b4ea489e
commit 6387f36efa

View File

@ -228,6 +228,8 @@ public class MetricFilterAutoConfigurationTests {
.andExpect(request().attribute(attributeName, is(notNullValue())))
.andReturn();
latch.countDown();
// Work around SPR-13079 which has not been fixed in 4.1.x
result.getAsyncResult();
mvc.perform(asyncDispatch(result)).andExpect(status().isCreated())
.andExpect(request().attribute(attributeName, is(nullValue())));
verify(context.getBean(CounterService.class)).increment("status.201.create");