mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-26 22:27:58 +01:00
[sinttest] Disconnect connection in LoginIntegrationTest
So that it will cause an connectionClosedOnError() callback, caused by an connection-timeout stream error.
This commit is contained in:
parent
7d129d6f6c
commit
2900cc2274
1 changed files with 8 additions and 4 deletions
|
@ -58,11 +58,15 @@ public class LoginIntegrationTest extends AbstractSmackLowLevelIntegrationTest {
|
|||
AbstractXMPPConnection connection = getUnconnectedConnection();
|
||||
connection.connect();
|
||||
|
||||
SASLErrorException saslErrorException = assertThrows(SASLErrorException.class,
|
||||
() -> connection.login(nonExistentUserString, invalidPassword));
|
||||
try {
|
||||
SASLErrorException saslErrorException = assertThrows(SASLErrorException.class,
|
||||
() -> connection.login(nonExistentUserString, invalidPassword));
|
||||
|
||||
SaslNonza.SASLFailure saslFailure = saslErrorException.getSASLFailure();
|
||||
assertEquals(SASLError.not_authorized, saslFailure.getSASLError());
|
||||
SaslNonza.SASLFailure saslFailure = saslErrorException.getSASLFailure();
|
||||
assertEquals(SASLError.not_authorized, saslFailure.getSASLError());
|
||||
} finally {
|
||||
connection.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue