Avoid deprecated Mockito methods
Issue: SPR-14880
This commit is contained in:
@@ -56,21 +56,22 @@ import static org.mockito.Mockito.*;
|
||||
*/
|
||||
public class WebSocketStompClientTests {
|
||||
|
||||
private TestWebSocketStompClient stompClient;
|
||||
|
||||
@Mock
|
||||
private TaskScheduler taskScheduler;
|
||||
|
||||
@Mock
|
||||
private ConnectionHandlingStompSession stompSession;
|
||||
|
||||
@Mock
|
||||
private WebSocketSession webSocketSession;
|
||||
|
||||
|
||||
private TestWebSocketStompClient stompClient;
|
||||
|
||||
private ArgumentCaptor<WebSocketHandler> webSocketHandlerCaptor;
|
||||
|
||||
private SettableListenableFuture<WebSocketSession> handshakeFuture;
|
||||
|
||||
@Mock
|
||||
private WebSocketSession webSocketSession;
|
||||
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
@@ -102,7 +103,7 @@ public class WebSocketStompClientTests {
|
||||
@SuppressWarnings("unchecked")
|
||||
public void webSocketConnectionEstablished() throws Exception {
|
||||
connect().afterConnectionEstablished(this.webSocketSession);
|
||||
verify(this.stompSession).afterConnected(isNotNull(TcpConnection.class));
|
||||
verify(this.stompSession).afterConnected(notNull());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -120,7 +121,7 @@ public class WebSocketStompClientTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public void handleWebSocketMessage() throws Exception {
|
||||
String text = "SEND\na:alpha\n\nMessage payload\0";
|
||||
connect().handleMessage(this.webSocketSession, new TextMessage(text));
|
||||
@@ -138,7 +139,7 @@ public class WebSocketStompClientTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public void handleWebSocketMessageSplitAcrossTwoMessage() throws Exception {
|
||||
WebSocketHandler webSocketHandler = connect();
|
||||
|
||||
@@ -163,7 +164,7 @@ public class WebSocketStompClientTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public void handleWebSocketMessageBinary() throws Exception {
|
||||
String text = "SEND\na:alpha\n\nMessage payload\0";
|
||||
connect().handleMessage(this.webSocketSession, new BinaryMessage(text.getBytes(StandardCharsets.UTF_8)));
|
||||
@@ -246,7 +247,7 @@ public class WebSocketStompClientTests {
|
||||
fail("Expected IllegalStateException");
|
||||
}
|
||||
catch (IllegalStateException ex) {
|
||||
// Ignore
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,7 +288,7 @@ public class WebSocketStompClientTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
public void cancelInactivityTasks() throws Exception {
|
||||
TcpConnection<byte[]> tcpConnection = getTcpConnection();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user