Skip to content

Commit

Permalink
Use junit-platform.properties to set default per_class behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
sdeleuze committed Aug 15, 2017
1 parent 64cca8e commit 7aef220
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 8 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ buildscript {
jcenter()
maven { setUrl("https://repo.spring.io/milestone") }
maven { setUrl("https://repo.spring.io/snapshot") }
maven { setUrl("https://oss.sonatype.org/content/repositories/snapshots") }
}

dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.4")
classpath("com.github.jengelman.gradle.plugins:shadow:2.0.1")
classpath("org.junit.platform:junit-platform-gradle-plugin:1.0.0-RC2")
classpath("org.junit.platform:junit-platform-gradle-plugin:1.0.0-SNAPSHOT")
}
}

Expand All @@ -29,6 +30,7 @@ repositories {
mavenCentral()
maven { setUrl("https://repo.spring.io/milestone") }
maven { setUrl("https://repo.spring.io/snapshot") }
maven { setUrl("https://oss.sonatype.org/content/repositories/snapshots") }
}

application {
Expand Down Expand Up @@ -57,15 +59,15 @@ dependencies {

compile("org.slf4j:slf4j-api:1.7.25")
compile("ch.qos.logback:logback-classic:1.2.3")

compile("com.fasterxml.jackson.module:jackson-module-kotlin:2.9.0")
compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.0")

compile("com.google.code.findbugs:jsr305:3.0.2") // Needed for now, could be removed when KT-19419 will be fixed

testCompile("io.projectreactor:reactor-test:3.1.0.M3")

testCompile("org.junit.jupiter:junit-jupiter-api:5.0.0-RC2")
testRuntime("org.junit.jupiter:junit-jupiter-engine:5.0.0-RC2")
testRuntime("org.junit.platform:junit-platform-launcher:1.0.0-RC2")
testCompile("org.junit.jupiter:junit-jupiter-api:5.0.0-SNAPSHOT")
testRuntime("org.junit.jupiter:junit-jupiter-engine:5.0.0-SNAPSHOT")
testRuntime("org.junit.platform:junit-platform-launcher:1.0.0-SNAPSHOT")
}
1 change: 1 addition & 0 deletions src/main/resources/junit-platform.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
junit.jupiter.testinstance.lifecycle.default = per_class
3 changes: 0 additions & 3 deletions src/test/kotlin/functional/IntegrationTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ package functional
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import org.junit.jupiter.api.TestInstance.Lifecycle.*
import org.springframework.http.MediaType.*
import org.springframework.web.reactive.function.client.WebClient
import org.springframework.web.reactive.function.client.bodyToFlux
import org.springframework.web.reactive.function.client.bodyToMono
import reactor.test.test
import java.time.LocalDate

@TestInstance(PER_CLASS)
class IntegrationTests {

val application = Application(8181)
Expand Down

5 comments on commit 7aef220

@sormuras
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘

@sbrannen
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! πŸ‘

@sbrannen
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But... wouldn't you rather store src/main/resources/junit-platform.properties under src/test/resources? 😜

@sdeleuze
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oups, fixed ddb5805

@sbrannen
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘

Please sign in to comment.