I have done a fair amount of research and don't see a good way to do this. I have a java application that has integration tests. For the sake of the integration tests, the tests need to start the actual application. This is done like so in each junit test.
@BeforeClass
final public static void setup() {
Application.main(new String[]{});
}
How do I shut down the application though? I notice it stays around as rogue process after the junit tests shutdown. In addition I have done this with springboot before and am aware that springboot provides annotations. We cannot use springboot though for this. So i need to find a non spring way. How do I shut down the application in a junit test?