MockRestServiceServer simulate backend timeout in integration test

前端 未结 5 1903
太阳男子
太阳男子 2021-02-12 20:02

I am writing some kind of integration test on my REST controller using MockRestServiceServer to mock backend behaviour. What I am trying to achieve now is to simulate very slow

5条回答
  •  独厮守ぢ
    2021-02-12 20:34

    In Restito, there is a buil-in function to simulate timeout:

    import static com.xebialabs.restito.semantics.Action.delay
    
    whenHttp(server).
       match(get("/something")).
       then(delay(201), stringContent("{}"))
    

提交回复
热议问题