Last active
December 16, 2015 07:38
-
-
Save finnjohnsen/5399709 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void "starting jobs creates threads"() { | |
when: | |
myService.startJobs() | |
Thread.sleep(300) | |
then: | |
Thread.getAllStackTraces().keySet().findAll \\ | |
{Thread thread -> thread.name.contains "Job"}.size() > 1 | |
cleanup: | |
myService.endJobs() //important, or you risk threads contaminating your next test. (happened to me) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment