28 lines
554 B
Kotlin
28 lines
554 B
Kotlin
package eventDemo.testHelpers
|
|
|
|
import org.koin.core.Koin
|
|
import redis.clients.jedis.UnifiedJedis
|
|
import javax.sql.DataSource
|
|
|
|
fun DataSource.cleanEventSource() {
|
|
this.connection.use {
|
|
it
|
|
.prepareStatement(
|
|
"""
|
|
truncate game.game_event_stream;
|
|
truncate auth.user_event_stream;
|
|
truncate auth.user;
|
|
""".trimIndent(),
|
|
).execute()
|
|
}
|
|
}
|
|
|
|
fun UnifiedJedis.cleanProjections() {
|
|
flushAll()
|
|
}
|
|
|
|
fun Koin.cleanDataTest() {
|
|
get<DataSource>().cleanEventSource()
|
|
get<UnifiedJedis>().cleanProjections()
|
|
}
|