Fixed unit test for shared storage
This commit is contained in:
parent
6f43b2bcec
commit
3b1d699463
|
@ -21,7 +21,6 @@ import dorkbox.network.connection.Connection
|
||||||
import dorkbox.network.storage.SettingsStore
|
import dorkbox.network.storage.SettingsStore
|
||||||
import dorkbox.network.storage.StorageType
|
import dorkbox.network.storage.StorageType
|
||||||
import dorkbox.network.storage.types.*
|
import dorkbox.network.storage.types.*
|
||||||
import kotlinx.coroutines.runBlocking
|
|
||||||
import mu.KLogger
|
import mu.KLogger
|
||||||
import mu.KotlinLogging
|
import mu.KotlinLogging
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
|
@ -45,20 +44,19 @@ class StorageTest : BaseTest() {
|
||||||
settingsStore = sharedStore
|
settingsStore = sharedStore
|
||||||
}
|
}
|
||||||
val server = Server<Connection>(serverConfig)
|
val server = Server<Connection>(serverConfig)
|
||||||
|
server.bind()
|
||||||
|
|
||||||
val config = clientConfig {
|
val config = clientConfig {
|
||||||
settingsStore = sharedStore
|
settingsStore = sharedStore
|
||||||
}
|
}
|
||||||
val client = Client<Connection>(config)
|
val client = Client<Connection>(config)
|
||||||
server.bind()
|
|
||||||
|
|
||||||
runBlocking {
|
|
||||||
client.connect("localhost")
|
|
||||||
|
|
||||||
Assert.assertFalse(server.storage.getSalt().contentEquals(client.storage.getSalt()))
|
client.connect("localhost")
|
||||||
|
|
||||||
server.close()
|
Assert.assertTrue(server.storage.getSalt().contentEquals(client.storage.getSalt()))
|
||||||
}
|
|
||||||
|
server.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user