44
55package com .bitpay .sdk .client ;
66
7- import com .bitpay .sdk .util .TokenContainer ;
87import com .bitpay .sdk .util .GuidGenerator ;
8+ import com .bitpay .sdk .util .TokenContainer ;
99import com .sun .net .httpserver .HttpExchange ;
1010import com .sun .net .httpserver .HttpHandler ;
1111import com .sun .net .httpserver .HttpServer ;
2323import org .apache .commons .io .FileUtils ;
2424import org .apache .http .impl .client .HttpClientBuilder ;
2525import org .bitcoinj .core .ECKey ;
26- import org .junit .jupiter .api .AfterEach ;
27- import org .junit .jupiter .api .BeforeEach ;
26+ import org .junit .jupiter .api .AfterAll ;
27+ import org .junit .jupiter .api .BeforeAll ;
2828import org .junit .jupiter .api .TestInstance ;
2929import org .junit .jupiter .api .extension .ExtendWith ;
3030import org .mockito .Mock ;
@@ -43,19 +43,19 @@ public class AbstractClientTest {
4343 @ Mock
4444 protected GuidGenerator uuidGenerator ;
4545
46- private int port = 8000 ;
46+ private int port ;
4747
4848 public AbstractClientTest () {
4949 }
5050
51- @ BeforeEach
51+ @ BeforeAll
5252 public void beforeEach () throws IOException {
5353 this .port = ThreadLocalRandom .current ().nextInt (8000 , 9000 );
5454 this .httpServer = HttpServer .create (new InetSocketAddress (port ), 0 );
5555 this .httpServer .start ();
5656 }
5757
58- @ AfterEach
58+ @ AfterAll
5959 public void afterEach () {
6060 this .httpServer .stop (0 );
6161 }
0 commit comments