This commit is contained in:
Clebert Suconic 2019-07-23 15:01:22 -04:00
commit fa000524e1
1 changed files with 36 additions and 23 deletions

View File

@ -100,6 +100,8 @@ public class StompV11Test extends StompTestBase {
server.getSecurityStore().setSecurityEnabled(true);
StompClientConnection connection = StompClientConnectionFactory.createClientConnection(v10Uri);
try {
connection.connect(defUser, defPass);
assertTrue(connection.isConnected());
@ -108,6 +110,8 @@ public class StompV11Test extends StompTestBase {
connection.disconnect();
connection.closeTransport();
connection = StompClientConnectionFactory.createClientConnection(uri);
connection.connect(defUser, defPass);
@ -118,6 +122,8 @@ public class StompV11Test extends StompTestBase {
connection.disconnect();
connection.closeTransport();
connection = StompClientConnectionFactory.createClientConnection(uri);
connection.connect();
@ -132,12 +138,19 @@ public class StompV11Test extends StompTestBase {
conn.disconnect();
conn.closeTransport();
//invalid user
conn = (StompClientConnectionV11) StompClientConnectionFactory.createClientConnection(uri);
ClientStompFrame frame = conn.connect("invaliduser", defPass);
assertFalse(conn.isConnected());
assertTrue(Stomp.Responses.ERROR.equals(frame.getCommand()));
assertTrue(frame.getBody().contains("Security Error occurred"));
conn.closeTransport();
} finally {
connection.closeTransport();
}
}
@Test