File tree Expand file tree Collapse file tree 3 files changed +13
-14
lines changed
src/test/java/ma/luan/yiyan Expand file tree Collapse file tree 3 files changed +13
-14
lines changed Original file line number Diff line number Diff line change 1111import io .vertx .ext .web .client .WebClient ;
1212import io .vertx .ext .web .client .WebClientOptions ;
1313import ma .luan .yiyan .MainVerticle ;
14- import org .junit .Before ;
14+ import org .junit .BeforeClass ;
1515import org .junit .Test ;
1616import org .junit .runner .RunWith ;
1717
2424
2525@ RunWith (VertxUnitRunner .class )
2626public class ApiVerticleTest {
27- private WebClient webClient ;
27+ private static WebClient webClient ;
2828
29- @ Before
30- public void beforeClass (TestContext context ) {
29+ @ BeforeClass
30+ public static void beforeClass (TestContext context ) {
3131 Async async = context .async ();
3232 Vertx vertx = Vertx .vertx ();
3333 JsonObject config = new JsonObject (vertx .
Original file line number Diff line number Diff line change 88import io .vertx .ext .unit .TestContext ;
99import io .vertx .ext .unit .junit .VertxUnitRunner ;
1010import ma .luan .yiyan .constants .Key ;
11- import org .junit .Before ;
11+ import org .junit .BeforeClass ;
1212import org .junit .Test ;
1313import org .junit .runner .RunWith ;
1414
1919
2020@ RunWith (VertxUnitRunner .class )
2121public class DataServiceTest {
22- private Vertx vertx ;
22+ private static Vertx vertx ;
2323
24- @ Before
25- public void beforeClass (TestContext context ) {
24+ @ BeforeClass
25+ public static void beforeClass (TestContext context ) {
2626 Async async = context .async ();
2727 vertx = Vertx .vertx ();
2828 JsonObject config = new JsonObject (vertx .
Original file line number Diff line number Diff line change 77import io .vertx .ext .unit .TestContext ;
88import io .vertx .ext .unit .junit .VertxUnitRunner ;
99import ma .luan .yiyan .constants .Key ;
10- import org .junit .Before ;
10+ import org .junit .BeforeClass ;
1111import org .junit .Test ;
1212import org .junit .runner .RunWith ;
1313
1717
1818@ RunWith (VertxUnitRunner .class )
1919public class LogServiceTest {
20- private Vertx vertx ;
21- private JsonObject config ;
20+ private static Vertx vertx ;
2221
23- @ Before
24- public void beforeClass (TestContext context ) {
22+ @ BeforeClass
23+ public static void beforeClass (TestContext context ) {
2524 Async async = context .async ();
2625 vertx = Vertx .vertx ();
27- config = new JsonObject (vertx .
26+ JsonObject config = new JsonObject (vertx .
2827 fileSystem ().readFileBlocking ("conf.json" ));
2928 vertx .deployVerticle (new LogService (), new DeploymentOptions ().setConfig (config ), c -> {
3029 async .complete ();
You can’t perform that action at this time.
0 commit comments