Fix integration test using XEP-0133 credentials

for the created connections.
This commit is contained in:
Florian Schmaus 2016-12-19 14:13:53 +01:00
parent a8a148945f
commit cfe5c2233d
1 changed files with 5 additions and 3 deletions

View File

@ -547,16 +547,18 @@ public class SmackIntegrationTestFramework {
XMPPTCPConnection connection = new XMPPTCPConnection(builder.build());
connection.connect();
if (config.isAccountRegistrationPossible()) {
IntTestUtil.registerAccount(connection, accountUsername, accountPassword, config);
UsernameAndPassword uap = IntTestUtil.registerAccount(connection, accountUsername, accountPassword, config);
// TODO is this still required?
// Some servers, e.g. Openfire, do not support a login right after the account was
// created, so disconnect and re-connection the connection first.
connection.disconnect();
connection.connect();
}
connection.login();
connection.login(uap.username, uap.password);
} else {
connection.login();
}
return connection;
}