Skip to content

Commit 728fa19

Browse files
committed
Fix Gradle plugin's tests following JUnit 5 upgrade
Closes gh-322
1 parent 4c3d7b1 commit 728fa19

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

spring-javaformat-gradle/spring-javaformat-gradle-plugin/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jar {
2020
}
2121

2222
test {
23+
useJUnitPlatform()
2324
testLogging {
2425
events "passed", "skipped", "failed"
2526
}

spring-javaformat-gradle/spring-javaformat-gradle-plugin/src/test/java/io/spring/javaformat/gradle/CheckTaskTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2021 the original author or authors.
2+
* Copyright 2017-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -45,11 +45,11 @@
4545
@ExtendWith(GradleBuildExtension.class)
4646
public class CheckTaskTests {
4747

48+
private final GradleBuild gradleBuild = new GradleBuild();
49+
4850
@TempDir
4951
public File temp;
5052

51-
public GradleBuild gradleBuild;
52-
5353
@Test
5454
public void checkOk() throws IOException {
5555
BuildResult result = this.gradleBuild.source("src/test/resources/check-ok").build("check");

spring-javaformat-gradle/spring-javaformat-gradle-plugin/src/test/java/io/spring/javaformat/gradle/FormatTaskTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2021 the original author or authors.
2+
* Copyright 2017-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@
3939
@ExtendWith(GradleBuildExtension.class)
4040
public class FormatTaskTests {
4141

42-
public GradleBuild gradleBuild;
42+
private final GradleBuild gradleBuild = new GradleBuild();
4343

4444
@Test
4545
public void checkOk() throws IOException {

0 commit comments

Comments
 (0)