From 4869e349afd002ff6ceea7863ce36b526f9e931f Mon Sep 17 00:00:00 2001 From: xen Date: Tue, 12 Feb 2019 11:43:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=90=AF=E5=8A=A8=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/java/ma/luan/yiyan/api/ApiVerticleTest.java | 8 ++++---- .../java/ma/luan/yiyan/service/DataServiceTest.java | 8 ++++---- .../java/ma/luan/yiyan/service/LogServiceTest.java | 11 +++++------ 3 files changed, 13 insertions(+), 14 deletions(-) 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();