Consistent SmartLifecycle implementations
Issue: SPR-14233
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,16 +16,12 @@
|
||||
|
||||
package org.springframework.web.socket.messaging;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
import java.net.URI;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
@@ -50,6 +46,9 @@ import org.springframework.web.socket.WebSocketHandler;
|
||||
import org.springframework.web.socket.WebSocketSession;
|
||||
import org.springframework.web.socket.client.WebSocketClient;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link WebSocketStompClient}.
|
||||
*
|
||||
@@ -91,6 +90,7 @@ public class WebSocketStompClientTests {
|
||||
.thenReturn(this.handshakeFuture);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void webSocketHandshakeFailure() throws Exception {
|
||||
connect();
|
||||
@@ -246,9 +246,9 @@ public class WebSocketStompClientTests {
|
||||
stompClient.setDefaultHeartbeat(new long[] {5, 5});
|
||||
try {
|
||||
stompClient.processConnectHeaders(null);
|
||||
fail("Expected exception");
|
||||
fail("Expected IllegalStateException");
|
||||
}
|
||||
catch (IllegalArgumentException ex) {
|
||||
catch (IllegalStateException ex) {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
@@ -308,7 +308,6 @@ public class WebSocketStompClientTests {
|
||||
|
||||
|
||||
private WebSocketHandler connect() {
|
||||
|
||||
this.stompClient.connect("/foo", mock(StompSessionHandler.class));
|
||||
|
||||
verify(this.stompSession).getSessionFuture();
|
||||
@@ -354,7 +353,6 @@ public class WebSocketStompClientTests {
|
||||
|
||||
private ConnectionHandlingStompSession stompSession;
|
||||
|
||||
|
||||
public TestWebSocketStompClient(WebSocketClient webSocketClient) {
|
||||
super(webSocketClient);
|
||||
}
|
||||
@@ -369,4 +367,4 @@ public class WebSocketStompClientTests {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user