Skip to content

Commit 745a7bc

Browse files
authored
Run WebServer once per class instead of method (#1903)
1 parent b735dbb commit 745a7bc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

client/src/test/java/org/asynchttpclient/AbstractBasicTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
import org.eclipse.jetty.server.Server;
2020
import org.eclipse.jetty.server.ServerConnector;
2121
import org.eclipse.jetty.server.handler.AbstractHandler;
22+
import org.junit.jupiter.api.AfterAll;
2223
import org.junit.jupiter.api.AfterEach;
24+
import org.junit.jupiter.api.BeforeAll;
2325
import org.junit.jupiter.api.BeforeEach;
2426
import org.junit.jupiter.api.TestInstance;
2527
import org.slf4j.Logger;
@@ -36,7 +38,7 @@ public abstract class AbstractBasicTest {
3638
protected int port1 = -1;
3739
protected int port2 = -1;
3840

39-
@BeforeEach
41+
@BeforeAll
4042
public void setUpGlobal() throws Exception {
4143
server = new Server();
4244
ServerConnector connector1 = addHttpConnector(server);
@@ -50,7 +52,7 @@ public void setUpGlobal() throws Exception {
5052
logger.info("Local HTTP server started successfully");
5153
}
5254

53-
@AfterEach
55+
@AfterAll
5456
public void tearDownGlobal() throws Exception {
5557
logger.debug("Shutting down local server: {}", server);
5658

0 commit comments

Comments
 (0)