mercredi 25 février 2015

Does Spring's Mock MVC framework support testing of async REST endpoints?

As an experiment, I switched one of our REST endpoints to use the Callback form of the controller and found that our unit tests failed. The way they are failing makes me think that the callback in not getting invoked. Does the testing framework have async support? I'm using Spring 4.1.4.RELEASE.



@RequestMapping( method = POST, produces = HypermediaControl.MIME_TYPE )
Callable<ResponseEntity<HypermediaControl>> store( ... )

def mockMvc = MockMvcBuilders.standaloneSetup( sut ).setAsyncRequestTimeout( 1000 ).build()
def requestBuilder = MockMvcRequestBuilders.post( '/' )
def result = mockMvc.perform( requestBuilder ).andReturn()


Any help is appreciated.


Aucun commentaire:

Enregistrer un commentaire