Skip to content

Commit

Permalink
move zkRegCenter.init() and zkRegCenter.close() to @BeforeAll and @af…
Browse files Browse the repository at this point in the history
…terall to make tests run faster and look similar to other tests
  • Loading branch information
TestBoost committed Dec 14, 2023
1 parent 0b3a6eb commit 98bf060
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer;
import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils;
import org.awaitility.Awaitility;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
Expand All @@ -48,21 +47,17 @@ class OneOffJobBootstrapTest {

private static final int SHARDING_TOTAL_COUNT = 3;

private ZookeeperRegistryCenter zkRegCenter;
private static ZookeeperRegistryCenter zkRegCenter;

@BeforeAll
static void init() {
EMBED_TESTING_SERVER.start();
}

@BeforeEach
void setUp() {
zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION);
zkRegCenter.init();
}

@AfterEach
void tearDown() {
@AfterAll
static void tearDown() {
zkRegCenter.close();
}

Expand Down

0 comments on commit 98bf060

Please sign in to comment.