Skip to content

Commit a8729b3

Browse files
author
Daniel Rees
authored
JUnit 5 (#58)
1 parent 5130bd3 commit a8729b3

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

build.gradle

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,21 @@ repositories {
1717
mavenCentral()
1818
}
1919

20+
test {
21+
useJUnitPlatform()
22+
}
23+
2024
dependencies {
2125
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
2226
compile "com.google.code.gson:gson:2.8.5"
2327
compile "com.squareup.okhttp3:okhttp:3.12.2"
2428

29+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
30+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
31+
32+
testCompileOnly 'junit:junit:4.12'
33+
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.3.1'
2534

26-
testCompile group: 'junit', name: 'junit', version: '4.12'
2735
testCompile group: 'com.google.truth', name: 'truth', version: '0.44'
2836
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.27.0'
2937
testCompile group: 'com.nhaarman.mockitokotlin2', name: 'mockito-kotlin', version: '2.1.0'
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package org.phoenixframework
2+
3+
import com.google.common.truth.Truth.assertThat
4+
import org.junit.jupiter.api.DisplayName
5+
import org.junit.jupiter.api.Nested
6+
import org.junit.jupiter.api.Test
7+
8+
class ExampleTest {
9+
@Test
10+
internal fun `should fail`() {
11+
// assertThat(true).isFalse()
12+
assertThat(true).isTrue()
13+
}
14+
15+
@Nested
16+
@DisplayName("nested test")
17+
inner class NestedTest {
18+
19+
@Test
20+
internal fun `does fail`() {
21+
assertThat(false).isFalse()
22+
}
23+
}
24+
}
25+

0 commit comments

Comments
 (0)