Skip to content

Commit

Permalink
Merge pull request #604 from scireum/feature/mbo/OX-10357
Browse files Browse the repository at this point in the history
JUnit: Migrate RedisTest to Kotlin
  • Loading branch information
mkeckmkeck authored Jan 26, 2024
2 parents c7d58cc + 5543d3c commit 4892dd7
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/test/java/sirius/db/redis/RedisSpec.groovy

This file was deleted.

33 changes: 33 additions & 0 deletions src/test/kotlin/sirius/db/redis/RedisTest.kt
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)
}
}

0 comments on commit 4892dd7

Please sign in to comment.