Skip to content

Commit 4892dd7

Browse files
authored
Merge pull request #604 from scireum/feature/mbo/OX-10357
JUnit: Migrate RedisTest to Kotlin
2 parents c7d58cc + 5543d3c commit 4892dd7

File tree

2 files changed

+33
-29
lines changed

2 files changed

+33
-29
lines changed

src/test/java/sirius/db/redis/RedisSpec.groovy

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Made with all the love in the world
3+
* by scireum in Remshalden, Germany
4+
*
5+
* Copyright by scireum GmbH
6+
* http://www.scireum.de - [email protected]
7+
*/
8+
9+
package sirius.db.redis
10+
11+
import org.junit.jupiter.api.Test
12+
import org.junit.jupiter.api.extension.ExtendWith
13+
import sirius.kernel.SiriusExtension
14+
import sirius.kernel.di.std.Part
15+
import kotlin.test.assertEquals
16+
17+
@ExtendWith(SiriusExtension::class)
18+
class RedisTest {
19+
20+
companion object {
21+
@Part
22+
private lateinit var redis: Redis
23+
}
24+
25+
@Test
26+
fun `basic GET SET works`() {
27+
val testString = System.currentTimeMillis().toString()
28+
29+
redis.exec({ -> "Setting a test value" }, { db -> db.set("TEST", testString) })
30+
31+
assertEquals(redis.query({ -> "Getting a test value" }, { db -> db.get("TEST") }), testString)
32+
}
33+
}

0 commit comments

Comments
 (0)