How to use JUnit to test asynchronous processes

前端 未结 18 1663
小蘑菇
小蘑菇 2020-11-29 15:06

How do you test methods that fire asynchronous processes with JUnit?

I don\'t know how to make my test wait for the process to end (it is not exactly a unit test, it

18条回答
  •  北荒
    北荒 (楼主)
    2020-11-29 15:46

    You can try using the Awaitility library. It makes it easy to test the systems you're talking about.

提交回复
热议问题