For my Spark API I'm building integration tests. Sometimes I want to stop and start the Spark instance. When I do that I sometimes run into the problem that I'm creating a new Spark instance, while the old one is still shutting down on a separate thread. It would be helpful to know when the Spark instance actually shut down.
First I start my Spark instance like this:
Spark.init();
Spark.awaitInitialization();
Then I stop it like this:
Spark.stop();
Now after I call stop(), the Spark Service hasn't actually stopped!
Is there a similar functionality to awaitInitialization() or another way of knowing when the Spark service actually stopped?