Skip to content

Commit 95e4f19

Browse files
author
Vincent Potucek
committed
use default field for default test path
1 parent b7c829e commit 95e4f19

31 files changed

+73
-67
lines changed

plugin-gradle/src/test/java/com/diffplug/gradle/spotless/KotlinExtensionTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2024 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
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.
@@ -231,7 +231,7 @@ void testWithCustomMaxWidthDefaultStyleKtfmt() throws IOException {
231231
}
232232

233233
private void checkKtlintOfficialStyle() throws IOException {
234-
String path = "src/main/kotlin/Main.kt";
234+
path = "src/main/kotlin/Main.kt";
235235
setFile(path).toResource("kotlin/ktlint/experimentalEditorConfigOverride.dirty");
236236
gradleRunner().withArguments("spotlessApply").build();
237237
assertFile(path).sameAsResource("kotlin/ktlint/experimentalEditorConfigOverride.ktlintOfficial.clean");

plugin-maven/src/test/java/com/diffplug/spotless/maven/MavenProvisionerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
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.
@@ -38,7 +38,7 @@ void testSingleDependencyIncludingTransitives() throws Exception {
3838
}
3939

4040
private void assertResolveDependenciesWorks() throws Exception {
41-
String path = "src/main/java/test.java";
41+
path = "src/main/java/test.java";
4242
String unformattedContent = "package a;";
4343
setFile(path).toContent(unformattedContent);
4444
mavenRunner().withArguments("spotless:apply").runNoError();

plugin-maven/src/test/java/com/diffplug/spotless/maven/antlr4/Antlr4FormatterTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2021 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
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.
@@ -46,7 +46,7 @@ void applyUsingDefaultVersionSelfclosing() throws Exception {
4646
}
4747

4848
private void runTest() throws Exception {
49-
String path = "src/main/antlr4/Hello.g4";
49+
path = "src/main/antlr4/Hello.g4";
5050
setFile(path).toResource("antlr4/Hello.unformatted.g4");
5151
mavenRunner().withArguments("spotless:apply").runNoError();
5252
assertFile(path).sameAsResource("antlr4/Hello.formatted.g4");

plugin-maven/src/test/java/com/diffplug/spotless/maven/generic/IndentTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2021 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
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.
@@ -48,7 +48,7 @@ private void runToSpacesTest() throws Exception {
4848
}
4949

5050
private void runTest(String source, String target) throws Exception {
51-
String path = "src/main/java/test.java";
51+
path = "src/main/java/test.java";
5252
setFile(path).toResource(source);
5353
mavenRunner().withArguments("spotless:apply").runNoError();
5454
assertFile(path).sameAsResource(target);

plugin-maven/src/test/java/com/diffplug/spotless/maven/generic/Jsr223Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 DiffPlug
2+
* Copyright 2021-2025 DiffPlug
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.
@@ -51,7 +51,7 @@ public void groovyFromJarState() throws Exception {
5151
}
5252

5353
private void runTest(String sourceContent, String targetContent) throws Exception {
54-
String path = "src/main/java/test.java";
54+
path = "src/main/java/test.java";
5555
setFile(path).toContent(sourceContent);
5656
mavenRunner().withArguments("spotless:apply").runNoError();
5757
assertFile(path).hasContent(targetContent);

plugin-maven/src/test/java/com/diffplug/spotless/maven/generic/LicenseHeaderTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2021 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
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.
@@ -61,7 +61,7 @@ void fromContentGroovy() throws Exception {
6161
" </content>",
6262
"</licenseHeader>");
6363

64-
String path = "src/main/groovy/test.groovy";
64+
path = "src/main/groovy/test.groovy";
6565
setFile(path).toResource("license/MissingLicense.test");
6666
mavenRunner().withArguments("spotless:apply").runNoError();
6767
assertFile(path).sameAsResource("license/HasLicense.test");
@@ -123,7 +123,7 @@ void fromContentKotlin() throws Exception {
123123
" </content>",
124124
"</licenseHeader>");
125125

126-
String path = "src/main/kotlin/test.kt";
126+
path = "src/main/kotlin/test.kt";
127127
String noLicenseHeader = getTestResource("kotlin/licenseheader/KotlinCodeWithoutHeader.test");
128128

129129
setFile(path).toContent(noLicenseHeader);
@@ -142,7 +142,7 @@ void unsupportedModuleInfo() throws Exception {
142142
}
143143

144144
private void runTest() throws Exception {
145-
String path = "src/main/java/test.java";
145+
path = "src/main/java/test.java";
146146
setFile(path).toResource("license/MissingLicense.test");
147147
mavenRunner().withArguments("spotless:apply").runNoError();
148148
assertFile(path).sameAsResource("license/HasLicense.test");
@@ -156,7 +156,7 @@ private void testUnsupportedFile(String file) throws Exception {
156156
" </content>",
157157
"</licenseHeader>");
158158

159-
String path = "src/main/java/com/diffplug/spotless/" + file;
159+
path = "src/main/java/com/diffplug/spotless/" + file;
160160
setFile(path).toResource("license/" + file + ".test");
161161

162162
mavenRunner().withArguments("spotless:apply").runNoError();

plugin-maven/src/test/java/com/diffplug/spotless/maven/generic/LineEndingsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2021 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
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.
@@ -44,7 +44,7 @@ private void runToUnixTest() throws Exception {
4444
}
4545

4646
private void runTest(String sourceContent, String targetContent) throws Exception {
47-
String path = "src/main/java/test.java";
47+
path = "src/main/java/test.java";
4848
setFile(path).toContent(sourceContent);
4949
mavenRunner().withArguments("spotless:apply").runNoError();
5050
assertFile(path).hasContent(targetContent);

plugin-maven/src/test/java/com/diffplug/spotless/maven/generic/NativeCmdTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 DiffPlug
2+
* Copyright 2021-2025 DiffPlug
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.
@@ -41,7 +41,7 @@ public void fromStdInToStdOut() throws Exception {
4141
}
4242

4343
private void runTest(String sourceContent, String targetContent) throws Exception {
44-
String path = "src/main/java/test.java";
44+
path = "src/main/java/test.java";
4545
setFile(path).toContent(sourceContent);
4646
mavenRunner().withArguments("spotless:apply").runNoError();
4747
assertFile(path).hasContent(targetContent);

plugin-maven/src/test/java/com/diffplug/spotless/maven/generic/ReplaceRegexTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2021 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
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.
@@ -34,7 +34,7 @@ void fromContent() throws Exception {
3434
}
3535

3636
private void runTest(String sourceContent, String targetContent) throws Exception {
37-
String path = "src/main/java/test.java";
37+
path = "src/main/java/test.java";
3838
setFile(path).toContent(sourceContent);
3939
mavenRunner().withArguments("spotless:apply").runNoError();
4040
assertFile(path).hasContent(targetContent);

plugin-maven/src/test/java/com/diffplug/spotless/maven/generic/ReplaceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2021 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
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.
@@ -33,7 +33,7 @@ void fromContent() throws Exception {
3333
}
3434

3535
private void runTest(String sourceContent, String targetContent) throws Exception {
36-
String path = "src/main/java/test.java";
36+
path = "src/main/java/test.java";
3737
setFile(path).toContent(sourceContent);
3838
mavenRunner().withArguments("spotless:apply").runNoError();
3939
assertFile(path).hasContent(targetContent);

0 commit comments

Comments
 (0)