Skip to content

Commit 30873bc

Browse files
committed
Update to JUnit 5 GA and refactor gradle configuration
1 parent 3790ea1 commit 30873bc

File tree

12 files changed

+120
-109
lines changed

12 files changed

+120
-109
lines changed
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
repositories {
2-
mavenCentral()
3-
}
4-
51
dependencies {
62
// Main-dependency needed for JUnit 5
7-
testCompile "org.junit.jupiter:junit-jupiter-api:5.0.0-${junit5RC}"
3+
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
84

95

106
// Commons
117
testCompile project(":common")
128

139

1410
// Logging
15-
testCompile "org.slf4j:slf4j-simple:${slf4jVersion}"
11+
testCompile "org.slf4j:slf4j-simple:${slf4j_version}"
1612
}

01_junit_5/build.gradle

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1-
repositories {
2-
mavenCentral()
3-
}
4-
51
dependencies {
62
// Main-dependency needed for JUnit 5
7-
testCompile "org.junit.jupiter:junit-jupiter-api:5.0.0-${junit5RC}"
3+
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
84

95

106
// Lagacy support for JUnit 4
11-
testCompile "org.junit.vintage:junit-vintage-engine:4.12.0-${junit5RC}"
7+
testCompile "org.junit.vintage:junit-vintage-engine:${junit5_vintage4_version}"
128

139

1410
// Commons
1511
testCompile project(":common")
1612

1713

1814
// Logging
19-
testCompile "org.slf4j:slf4j-simple:${slf4jVersion}"
15+
testCompile "org.slf4j:slf4j-simple:${slf4j_version}"
2016
}

02_assertj/build.gradle

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
1-
repositories {
2-
mavenCentral()
3-
}
4-
51
dependencies {
62
// Main-dependency needed for JUnit 5
7-
testCompile "org.junit.jupiter:junit-jupiter-api:5.0.0-${spring5RC}"
3+
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
84

95

106
// AssertJ
11-
testCompile "org.assertj:assertj-core:${assertJVersion}"
7+
testCompile "org.assertj:assertj-core:${assertj_version}"
128

139

1410
// Hamcrest for comparison
15-
testCompile "org.hamcrest:hamcrest-all:${hamcrestVersion}"
11+
testCompile "org.hamcrest:hamcrest-all:${hamcrest_version}"
1612

1713

1814
// Commons
1915
testCompile project(":common")
2016

2117

2218
// Logging
23-
testCompile "org.slf4j:slf4j-simple:${slf4jVersion}"
19+
testCompile "org.slf4j:slf4j-simple:${slf4j_version}"
2420
}
Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
1-
repositories {
2-
mavenCentral()
3-
maven { url 'https://repo.spring.io/snapshot' }
4-
maven { url 'https://repo.spring.io/milestone' }
5-
maven { url 'https://jitpack.io' }
6-
}
7-
81
dependencies {
92
// Main-dependency needed for JUnit 5
10-
testCompile "org.junit.jupiter:junit-jupiter-api:5.0.0-${junit5RC}"
3+
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
114

125
// Lagacy support for JUnit 4
13-
testCompile "org.junit.vintage:junit-vintage-engine:4.12.0-${junit5RC}"
6+
testCompile "org.junit.vintage:junit-vintage-engine:${junit5_vintage4_version}"
147

158
// Spring Boot 4
16-
compile "org.springframework.boot:spring-boot-starter-data-jpa:${springBoot4Version}"
17-
testCompile "org.springframework.boot:spring-boot-starter-test:${springBoot4Version}"
9+
compile "org.springframework.boot:spring-boot-starter-data-jpa:${spring4_boot_version}"
10+
testCompile "org.springframework.boot:spring-boot-starter-test:${spring4_boot_version}"
1811
// JUnit 5 Extension for Spring 4 Tests
19-
testCompile "com.github.sbrannen:spring-test-junit5:1.0.0.${spring5RC}"
12+
testCompile "com.github.sbrannen:spring-test-junit5:${junit5_spring4_test_version}"
2013

2114

2215
// Commons
2316
testCompile project(":common")
2417

2518
// Database Drivers
26-
runtime "org.hsqldb:hsqldb:${hsqldbDriverVersion}"
27-
runtime "org.postgresql:postgresql:${postgresqlDriverVersion}"
19+
runtime "org.hsqldb:hsqldb:${hsqldb_driver_version}"
20+
runtime "org.postgresql:postgresql:${postgresql_driver_version}"
2821
}
Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
1-
repositories {
2-
mavenCentral()
3-
maven { url "https://repo.spring.io/snapshot" }
4-
maven { url "https://repo.spring.io/milestone" }
5-
}
6-
71
dependencies {
82
// Main-dependency needed for JUnit 5
9-
testCompile "org.junit.jupiter:junit-jupiter-api:5.0.0-${junit5RC}"
3+
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
104
// Lagacy support for JUnit 4
11-
testCompile "org.junit.vintage:junit-vintage-engine:4.12.0-${junit5RC}"
5+
testCompile "org.junit.vintage:junit-vintage-engine:${junit5_vintage4_version}"
126

137

148
// Spring Boot 5
15-
compile "org.springframework.boot:spring-boot-starter-data-jpa:2.0.0.${springBoot5RC}"
16-
testCompile "org.springframework.boot:spring-boot-starter-test:2.0.0.${springBoot5RC}"
9+
compile "org.springframework.boot:spring-boot-starter-data-jpa:${spring5_boot_version}"
10+
testCompile "org.springframework.boot:spring-boot-starter-test:${spring5_boot_version}"
1711

1812

1913
// Commons
2014
testCompile project(":common")
2115

2216

2317
// Database Drivers
24-
runtime "org.hsqldb:hsqldb:${hsqldbDriverVersion}"
25-
runtime "org.postgresql:postgresql:${postgresqlDriverVersion}"
18+
runtime "org.hsqldb:hsqldb:${hsqldb_driver_version}"
19+
runtime "org.postgresql:postgresql:${postgresql_driver_version}"
2620
}
Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,25 @@
1-
repositories {
2-
mavenCentral()
3-
maven { url "https://repo.spring.io/snapshot" }
4-
maven { url "https://repo.spring.io/milestone" }
5-
maven { url 'https://jitpack.io' }
6-
}
7-
81
dependencies {
92
// Main-dependency needed for JUnit 5
10-
testCompile "org.junit.jupiter:junit-jupiter-api:5.0.0-${junit5RC}"
3+
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
114
// Lagacy support for JUnit 4
12-
testCompile "org.junit.vintage:junit-vintage-engine:4.12.0-${junit5RC}"
5+
testCompile "org.junit.vintage:junit-vintage-engine:${junit5_vintage4_version}"
136

147

158
// Spring 4
16-
compile "org.springframework.data:spring-data-jpa:${spring4Version}"
9+
compile "org.springframework.data:spring-data-jpa:${spring4_version}"
1710
// JUnit 5 Extension for Spring 4 Tests
18-
testCompile "com.github.sbrannen:spring-test-junit5:1.0.0.${spring5RC}"
11+
testCompile "com.github.sbrannen:spring-test-junit5:${junit5_spring4_test_version}"
1912

2013

2114
// Hibernate JPA
22-
compile "org.hibernate:hibernate-core:${hibernateCoreVersion}"
15+
compile "org.hibernate:hibernate-core:${hibernate_core_version}"
2316

2417

2518
// Commons
2619
compile project(":common")
2720

2821

2922
// Database Drivers
30-
runtime "org.hsqldb:hsqldb:${hsqldbDriverVersion}"
31-
runtime "org.postgresql:postgresql:${postgresqlDriverVersion}"
23+
runtime "org.hsqldb:hsqldb:${hsqldb_driver_version}"
24+
runtime "org.postgresql:postgresql:${postgresql_driver_version}"
3225
}
Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,24 @@
1-
repositories {
2-
mavenCentral()
3-
maven { url "https://repo.spring.io/snapshot" }
4-
maven { url "https://repo.spring.io/milestone" }
5-
maven { url 'https://jitpack.io' }
6-
}
7-
81
dependencies {
92
// Main-dependency needed for JUnit 5
10-
testCompile "org.junit.jupiter:junit-jupiter-api:5.0.0-${junit5RC}"
3+
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
114
// Lagacy support for JUnit 4
12-
testCompile "org.junit.vintage:junit-vintage-engine:4.12.0-${junit5RC}"
5+
testCompile "org.junit.vintage:junit-vintage-engine:${junit5_vintage4_version}"
136

147

158
// Spring 5
16-
compile "org.springframework.data:spring-data-jpa:2.0.0.${spring5RC}"
17-
testCompile "org.springframework:spring-test:5.0.0.${spring5RC}"
9+
compile "org.springframework.data:spring-data-jpa:${spring5_data_jpa_version}"
10+
testCompile "org.springframework:spring-test:${spring5_version}"
1811

1912

2013
// Hibernate JPA
21-
compile "org.hibernate:hibernate-core:${hibernateCoreVersion}"
14+
compile "org.hibernate:hibernate-core:${hibernate_core_version}"
2215

2316

2417
// Commons
2518
compile project(":common")
2619

2720

2821
// Database Drivers
29-
runtime "org.hsqldb:hsqldb:${hsqldbDriverVersion}"
30-
runtime "org.postgresql:postgresql:${postgresqlDriverVersion}"
22+
runtime "org.hsqldb:hsqldb:${hsqldb_driver_version}"
23+
runtime "org.postgresql:postgresql:${postgresql_driver_version}"
3124
}

04_testfx/build.gradle

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
repositories {
2-
mavenCentral()
3-
}
4-
51
dependencies {
62
// Main-dependency needed for JUnit 5
7-
testCompile "org.junit.jupiter:junit-jupiter-api:5.0.0-${junit5RC}"
3+
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
84

95

106
// Commons
117
testCompile project(":common")
128

139

1410
// Logging
15-
testCompile "org.slf4j:slf4j-simple:${slf4jVersion}"
11+
testCompile "org.slf4j:slf4j-simple:${slf4j_version}"
1612
}

05_mockito/build.gradle

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
repositories {
2-
mavenCentral()
3-
}
4-
51
dependencies {
62
// Main-dependency needed for JUnit 5
7-
testCompile "org.junit.jupiter:junit-jupiter-api:5.0.0-${junit5RC}"
3+
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
84

95

106
// Mockito
11-
testCompile "org.mockito:mockito-core:${mockitoVersion}"
7+
testCompile "org.mockito:mockito-core:${mockito_version}"
128

139

1410
// Commons
1511
testCompile project(":common")
1612

1713

1814
// Logging
19-
testCompile "org.slf4j:slf4j-simple:${slf4jVersion}"
15+
testCompile "org.slf4j:slf4j-simple:${slf4j_version}"
16+
2017
}

README.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Some headers related to code will have a code-link behind their name directing t
4848
<dependency>
4949
<groupId>org.junit.jupiter</groupId>
5050
<artifactId>junit-jupiter-api</artifactId>
51-
<version>5.0.0-RC2/version>
51+
<version>5.0.0/version>
5252
<scope>test</scope>
5353
</dependency>
5454
----
@@ -58,19 +58,19 @@ If you need lagacy support for JUnit 4 or even JUnit 3 to run in parallel to JUn
5858
<dependency>
5959
<groupId>org.junit.vintage</groupId>
6060
<artifactId>junit-vintage-engine</artifactId>
61-
<version>4.12.0-RC2</version>
61+
<version>4.12.0</version>
6262
<scope>test</scope>
6363
</dependency>
6464
----
6565

6666
.**Equivalents for Gradle**
6767
[source,gradle]
6868
----
69-
testCompile 'org.junit.jupiter:junit-jupiter-api:5.0.0-RC2'
69+
testCompile 'org.junit.jupiter:junit-jupiter-api:5.0.0'
7070
----
7171
[source,gradle]
7272
----
73-
testCompile 'org.junit.vintage:junit-vintage-engine:4.12.0-RC2'
73+
testCompile 'org.junit.vintage:junit-vintage-engine:4.12.0'
7474
----
7575

7676

0 commit comments

Comments
 (0)