@Test
public void testRunVerticleWithConfFile() throws Exception {
Path tempDir = testFolder.newFolder().toPath();
Path tempFile = Files.createTempFile(tempDir, "conf", "json");
Starter starter = new Starter();
JsonObject conf = new JsonObject().put("foo", "bar").put("wibble", 123);
Files.write(tempFile, conf.encode().getBytes());
String[] args = new String[]{"run", "java:" + TestVerticle.class.getCanonicalName(), "-conf", tempFile.toString()};
Thread t = new Thread(() -> {
starter.run(args);
});
t.start();
waitUntil(() -> TestVerticle.instanceCount.get() == 1);
assertTrue(t.isAlive()); // It's blocked
assertEquals(conf, TestVerticle.conf);
// Now unblock it
starter.unblock();
waitUntil(() -> !t.isAlive());
}