Minor: AuthDBTests - close RPC connections to prevent thread leaks

This commit is contained in:
Andrius Dagys 2018-01-10 17:06:54 +00:00
parent 8b5ad9d5c0
commit 0a56c75543

View File

@ -97,21 +97,21 @@ class AuthDBTests : NodeBasedTest() {
@Test @Test
fun `login with correct credentials`() { fun `login with correct credentials`() {
client.start("user", "foo") client.start("user", "foo").close()
} }
@Test @Test
fun `login with wrong credentials`() { fun `login with wrong credentials`() {
client.start("user", "foo") client.start("user", "foo").close()
assertFailsWith( assertFailsWith(
ActiveMQSecurityException::class, ActiveMQSecurityException::class,
"Login with incorrect password should fail") { "Login with incorrect password should fail") {
client.start("user", "bar") client.start("user", "bar").close()
} }
assertFailsWith( assertFailsWith(
ActiveMQSecurityException::class, ActiveMQSecurityException::class,
"Login with unknown username should fail") { "Login with unknown username should fail") {
client.start("X", "foo") client.start("X", "foo").close()
} }
} }
@ -153,7 +153,7 @@ class AuthDBTests : NodeBasedTest() {
assertFailsWith( assertFailsWith(
ActiveMQSecurityException::class, ActiveMQSecurityException::class,
"Login with incorrect password should fail") { "Login with incorrect password should fail") {
client.start("user2", "bar") client.start("user2", "bar").close()
} }
db.insert(UserAndRoles( db.insert(UserAndRoles(
@ -161,7 +161,7 @@ class AuthDBTests : NodeBasedTest() {
password = encodePassword("bar"), password = encodePassword("bar"),
roles = listOf("default"))) roles = listOf("default")))
client.start("user2", "bar") client.start("user2", "bar").close()
} }
@Test @Test