refactoring: Masive refactor to build the V2
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user