KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a method which adds a shutdown hook. I need to test (via JUnit) that the code executed in the hook is called : public void myMethod(){ Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { ... code to test ... } }); } How can I simulate a shutdown in my unit test ?
Tags (comma-separated)
Save Edits
Cancel