diff --git a/src/test/java/ma/luan/yiyan/api/ApiVerticleTest.java b/src/test/java/ma/luan/yiyan/api/ApiVerticleTest.java index 87dd38f..55b6ab8 100644 --- a/src/test/java/ma/luan/yiyan/api/ApiVerticleTest.java +++ b/src/test/java/ma/luan/yiyan/api/ApiVerticleTest.java @@ -11,7 +11,7 @@ import io.vertx.ext.web.client.WebClient; import io.vertx.ext.web.client.WebClientOptions; import ma.luan.yiyan.MainVerticle; -import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -24,10 +24,10 @@ @RunWith(VertxUnitRunner.class) public class ApiVerticleTest { - private WebClient webClient; + private static WebClient webClient; - @Before - public void beforeClass(TestContext context) { + @BeforeClass + public static void beforeClass(TestContext context) { Async async = context.async(); Vertx vertx = Vertx.vertx(); JsonObject config = new JsonObject(vertx. diff --git a/src/test/java/ma/luan/yiyan/service/DataServiceTest.java b/src/test/java/ma/luan/yiyan/service/DataServiceTest.java index ac71199..6570655 100644 --- a/src/test/java/ma/luan/yiyan/service/DataServiceTest.java +++ b/src/test/java/ma/luan/yiyan/service/DataServiceTest.java @@ -8,7 +8,7 @@ import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.junit.VertxUnitRunner; import ma.luan.yiyan.constants.Key; -import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -19,10 +19,10 @@ @RunWith(VertxUnitRunner.class) public class DataServiceTest { - private Vertx vertx; + private static Vertx vertx; - @Before - public void beforeClass(TestContext context) { + @BeforeClass + public static void beforeClass(TestContext context) { Async async = context.async(); vertx = Vertx.vertx(); JsonObject config = new JsonObject(vertx. diff --git a/src/test/java/ma/luan/yiyan/service/LogServiceTest.java b/src/test/java/ma/luan/yiyan/service/LogServiceTest.java index 1c960ee..e96a897 100644 --- a/src/test/java/ma/luan/yiyan/service/LogServiceTest.java +++ b/src/test/java/ma/luan/yiyan/service/LogServiceTest.java @@ -7,7 +7,7 @@ import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.junit.VertxUnitRunner; import ma.luan.yiyan.constants.Key; -import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -17,14 +17,13 @@ @RunWith(VertxUnitRunner.class) public class LogServiceTest { - private Vertx vertx; - private JsonObject config; + private static Vertx vertx; - @Before - public void beforeClass(TestContext context) { + @BeforeClass + public static void beforeClass(TestContext context) { Async async = context.async(); vertx = Vertx.vertx(); - config = new JsonObject(vertx. + JsonObject config = new JsonObject(vertx. fileSystem().readFileBlocking("conf.json")); vertx.deployVerticle(new LogService(), new DeploymentOptions().setConfig(config), c -> { async.complete();