i have a simple threaded application which simulates thread timeout, I'm using Thread.sleep(10000) in the thread to mimic the thread work ,
But i allso want to test this senariue in Junit .
but i can't find away to capture this in junit without adding throw in the method or the worker .
I'm causing this thread to be killed with a small timeout with:
I don't want to add exceptions to all the program hierarchies.
The exception I'm getting:
I guess assertThatThrownBy not going to work here as this exception not thrown
is there any way in jUnit to capture this?