File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
junit/mockwebserver/src/test/groovy/io/fabric8/mockwebserver Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ class DefaultMockServerWebSocketTest extends Specification {
182182 given : " A WebSocket expectation"
183183 server. expect()
184184 .withPath(" /websocket" )
185- .andUpgradeToWebSocket(). open(). done(). always()
185+ .andUpgradeToWebSocket(). open(). waitFor( 10L ) . andEmit( " done " ) . done(). always()
186186 and :
187187 def future = new CompletableFuture ()
188188 and : " A WebSocket request"
@@ -197,8 +197,9 @@ class DefaultMockServerWebSocketTest extends Specification {
197197 future. complete(ws. result(). headers(). get(" sec-websocket-protocol" ))
198198 }
199199 }
200- if (wsReq. result() != null && wsReq. result(). headers() != null ) {
201- future. complete(wsReq. result(). headers(). get(" sec-websocket-protocol" ))
200+ def currentResult = wsReq. result()
201+ if (currentResult != null && currentResult. headers() != null ) {
202+ future. complete(currentResult. headers(). get(" sec-websocket-protocol" ))
202203 }
203204 and : " An instance of AsyncConditions"
204205 def async = new AsyncConditions (1 )
You can’t perform that action at this time.
0 commit comments