Skip to content
This repository was archived by the owner on Aug 5, 2021. It is now read-only.

Commit 59faf6c

Browse files
committed
Migration to JUnit 5
1 parent dd43f86 commit 59faf6c

File tree

45 files changed

+385
-303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+385
-303
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ repositories {
2424
dependencies {
2525
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
2626
compile 'com.google.guava:guava:16.0'
27-
testCompile 'junit:junit:4.12'
27+
testCompile 'org.junit.jupiter:junit-jupiter:5.4.0'
2828
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package i_introduction._0_Hello_World
22

3-
import org.junit.Assert.assertEquals
4-
import org.junit.Test
3+
import org.junit.jupiter.api.Assertions.assertEquals
4+
import org.junit.jupiter.api.Test
55

66
class N00StartKtTest {
7-
@Test fun testOk() {
7+
@Test
8+
fun testOk() {
89
assertEquals("OK", task0())
910
}
1011
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package i_introduction._10_Object_Expressions
22

3-
import org.junit.Assert.assertEquals
4-
import org.junit.Test
3+
import org.junit.jupiter.api.Assertions.assertEquals
4+
import org.junit.jupiter.api.Test
55

66
class N10ObjectExpressionsKtTest {
7-
@Test fun testSort() {
7+
@Test
8+
fun testSort() {
89
assertEquals(listOf(5, 2, 1), task10())
910
}
1011
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package i_introduction._11_SAM_Conversions
22

3-
import org.junit.Assert.assertEquals
4-
import org.junit.Test
3+
import org.junit.jupiter.api.Assertions.assertEquals
4+
import org.junit.jupiter.api.Test
55

66
class N11SAMConversionsKtTest {
7-
@Test fun testSort() {
7+
@Test
8+
fun testSort() {
89
assertEquals(listOf(5, 2, 1), task11())
910
}
1011
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package i_introduction._12_Extensions_On_Collections
22

3-
import org.junit.Assert.assertEquals
4-
import org.junit.Test
3+
import org.junit.jupiter.api.Assertions.assertEquals
4+
import org.junit.jupiter.api.Test
55

66
class N12ExtensionsOnCollectionsKtTest {
7-
@Test fun testSort() {
7+
@Test
8+
fun testSort() {
89
assertEquals(listOf(5, 2, 1), task12())
910
}
1011
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package i_introduction._1_Java_To_Kotlin_Converter
22

3-
import org.junit.Assert.assertEquals
4-
import org.junit.Test
3+
import org.junit.jupiter.api.Assertions.assertEquals
4+
import org.junit.jupiter.api.Test
55

66
class N01JavaToKotlinConverterKtTest {
7-
@Test fun collection() {
7+
@Test
8+
fun collection() {
89
assertEquals("{1, 2, 3, 42, 555}", task1(listOf(1, 2, 3, 42, 555)))
910
}
1011
}

test/i_introduction/_2_Named_Arguments/N02NamedArgumentsKtTest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package i_introduction._2_Named_Arguments
22

3-
import org.junit.Assert.assertEquals
3+
import org.junit.jupiter.api.Assertions.assertEquals
4+
import org.junit.jupiter.api.Test
45

56
class N02NamedArgumentsKtTest {
67

7-
@org.junit.Test fun testJoinToString() {
8+
@Test
9+
fun testJoinToString() {
810
assertEquals("{1, 2, 3, 42, 555}", task2(listOf(1, 2, 3, 42, 555)))
911
}
1012

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package i_introduction._3_Default_Arguments
22

3-
import org.junit.Assert.assertEquals
4-
import org.junit.Test
3+
import org.junit.jupiter.api.Assertions.assertEquals
4+
import org.junit.jupiter.api.Test
55

66
class N03DefaultArgumentsKtTest {
77

8-
@Test fun testDefaultAndNamedParams() {
8+
@Test
9+
fun testDefaultAndNamedParams() {
910
assertEquals("a42b1C42D2", task3())
1011
}
1112
}
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
package i_introduction._4_Lambdas
22

3-
import org.junit.Assert.assertFalse
4-
import org.junit.Assert.assertTrue
5-
import org.junit.Test
3+
import org.junit.jupiter.api.Assertions.assertFalse
4+
import org.junit.jupiter.api.Assertions.assertTrue
5+
import org.junit.jupiter.api.Test
66

77
class N04LambdasKtTest {
8-
@Test fun contains() {
8+
@Test
9+
fun contains() {
910
assertTrue(task4(listOf(1, 2, 3)))
1011
}
1112

12-
@Test fun notContains() {
13+
@Test
14+
fun notContains() {
1315
assertFalse(task4(listOf(1, 3, 5)))
1416
}
1517
}
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
package i_introduction._5_String_Templates
22

3-
import org.junit.Assert.assertFalse
4-
import org.junit.Assert.assertTrue
5-
import org.junit.Test
6-
import java.util.regex.Pattern
3+
import org.junit.jupiter.api.Assertions.assertFalse
4+
import org.junit.jupiter.api.Assertions.assertTrue
5+
import org.junit.jupiter.api.Test
76

87
class N05StringTemplatesKtTest {
9-
@Test fun match() {
8+
@Test
9+
fun match() {
1010
assertTrue("11 MAR 1952".matches(task5().toRegex()))
1111
}
1212

13-
@Test fun match1() {
13+
@Test
14+
fun match1() {
1415
assertTrue("24 AUG 1957".matches(task5().toRegex()))
1516
}
1617

17-
@Test fun doNotMatch() {
18+
@Test
19+
fun doNotMatch() {
1820
assertFalse("24 RRR 1957".matches(task5().toRegex()))
1921
}
2022
}

0 commit comments

Comments
 (0)