-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #604 from scireum/feature/mbo/OX-10357
JUnit: Migrate RedisTest to Kotlin
- Loading branch information
Showing
2 changed files
with
33 additions
and
29 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Made with all the love in the world | ||
* by scireum in Remshalden, Germany | ||
* | ||
* Copyright by scireum GmbH | ||
* http://www.scireum.de - [email protected] | ||
*/ | ||
|
||
package sirius.db.redis | ||
|
||
import org.junit.jupiter.api.Test | ||
import org.junit.jupiter.api.extension.ExtendWith | ||
import sirius.kernel.SiriusExtension | ||
import sirius.kernel.di.std.Part | ||
import kotlin.test.assertEquals | ||
|
||
@ExtendWith(SiriusExtension::class) | ||
class RedisTest { | ||
|
||
companion object { | ||
@Part | ||
private lateinit var redis: Redis | ||
} | ||
|
||
@Test | ||
fun `basic GET SET works`() { | ||
val testString = System.currentTimeMillis().toString() | ||
|
||
redis.exec({ -> "Setting a test value" }, { db -> db.set("TEST", testString) }) | ||
|
||
assertEquals(redis.query({ -> "Getting a test value" }, { db -> db.get("TEST") }), testString) | ||
} | ||
} |