提交 8edbdf4d 编写于 作者: R Rossen Stoyanchev

Fix failing test

上级 a6b167dd
......@@ -17,8 +17,11 @@
package org.springframework.web.socket.adapter.jetty;
import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.api.UpgradeRequest;
import org.eclipse.jetty.websocket.api.UpgradeResponse;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.adapter.jetty.JettyWebSocketHandlerAdapter;
......@@ -45,6 +48,9 @@ public class JettyWebSocketHandlerAdapterTests {
@Before
public void setup() {
this.session = mock(Session.class);
when(this.session.getUpgradeRequest()).thenReturn(Mockito.mock(UpgradeRequest.class));
when(this.session.getUpgradeResponse()).thenReturn(Mockito.mock(UpgradeResponse.class));
this.webSocketHandler = mock(WebSocketHandler.class);
this.webSocketSession = new JettyWebSocketSession(null, null);
this.adapter = new JettyWebSocketHandlerAdapter(this.webSocketHandler, this.webSocketSession);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册