File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
src/test/java/org/java_websocket/misc Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 4040import org .java_websocket .util .SocketUtil ;
4141import org .junit .jupiter .api .*;
4242
43+ import static org .junit .jupiter .api .Assertions .assertTrue ;
4344import static org .junit .jupiter .api .Assertions .fail ;
4445
4546public class OpeningHandshakeRejectionTest {
@@ -48,10 +49,13 @@ public class OpeningHandshakeRejectionTest {
4849 private Thread thread ;
4950 private ServerSocket serverSocket ;
5051
52+ private boolean beforeeach_called ;
53+
5154 private static final String additionalHandshake = "Upgrade: websocket\r \n Connection: Upgrade\r \n \r \n " ;
5255
5356 @ BeforeEach ()
5457 public void startServer () throws InterruptedException {
58+
5559 port = SocketUtil .getAvailablePort ();
5660 thread = new Thread (
5761 () -> {
@@ -135,6 +139,7 @@ public void startServer() throws InterruptedException {
135139 }
136140 });
137141 thread .start ();
142+ beforeeach_called = true ;
138143 }
139144
140145 @ AfterEach
@@ -216,6 +221,7 @@ public void testHandshakeRejectionTestCase11() throws Exception {
216221 }
217222
218223 private void testHandshakeRejection (int i ) throws Exception {
224+ assertTrue (beforeeach_called , "BeforeEach is called" );
219225 final int finalI = i ;
220226 final CountDownLatch countDownLatch = new CountDownLatch (1 );
221227 WebSocketClient webSocketClient = new WebSocketClient (
You can’t perform that action at this time.
0 commit comments