✅ Lagt til JUnit
Co-authored-by: Sindre Kjelsrud <sindre.kjelsrud@nav.no> Co-authored-by: Markus A. R. Johansen <markus.aleksander.rakil.johansen@nav.no> Co-authored-by: Hege Haavaldsen <hege.haavaldsen@nav.no> Co-authored-by: Helene Arnesen <helene.arnesen@nav.no>
This commit is contained in:
parent
0388b06f93
commit
77abcef166
3 changed files with 26 additions and 0 deletions
|
@ -6,6 +6,7 @@ val postgresql_version: String by project
|
|||
val hikariCP_version: String by project
|
||||
val exposed_version: String by project
|
||||
val testcontainers_postgresql_version: String by project
|
||||
val junit_jupiter_version: String by project
|
||||
|
||||
|
||||
plugins {
|
||||
|
@ -46,4 +47,14 @@ dependencies {
|
|||
testImplementation("io.ktor:ktor-server-tests-jvm:$ktor_version")
|
||||
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version")
|
||||
testImplementation("org.testcontainers:postgresql:$testcontainers_postgresql_version")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:$junit_jupiter_version")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-params:$junit_jupiter_version")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junit_jupiter_version")
|
||||
}
|
||||
|
||||
tasks.named<Test>("test"){
|
||||
useJUnitPlatform()
|
||||
testLogging{
|
||||
events("skipped", "failed")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,3 +7,4 @@ postgresql_version=42.6.0
|
|||
hikariCP_version=5.0.1
|
||||
exposed_version=0.41.1
|
||||
testcontainers_postgresql_version=1.18.3
|
||||
junit_jupiter_version=5.9.3
|
||||
|
|
14
backend/src/test/kotlin/no/nav/helse/sprik/DbTest.kt
Normal file
14
backend/src/test/kotlin/no/nav/helse/sprik/DbTest.kt
Normal file
|
@ -0,0 +1,14 @@
|
|||
package no.nav.helse.sprik
|
||||
|
||||
import org.junit.jupiter.api.Test
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
|
||||
class DbTest {
|
||||
@Test
|
||||
fun `Tester noe rart for å sjekke om junit funker`() {
|
||||
val a = 2
|
||||
assertEquals(2, a)
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue