|
21 | 21 | import java.time.YearMonth;
|
22 | 22 | import java.time.ZoneOffset;
|
23 | 23 |
|
24 |
| -import com.diffplug.spotless.StepHarnessWithFile; |
25 |
| - |
26 | 24 | import org.junit.jupiter.api.Assertions;
|
27 | 25 | import org.junit.jupiter.api.Test;
|
28 | 26 |
|
29 | 27 | import com.diffplug.spotless.FormatterStep;
|
30 | 28 | import com.diffplug.spotless.ResourceHarness;
|
31 | 29 | import com.diffplug.spotless.SerializableEqualityTester;
|
32 | 30 | import com.diffplug.spotless.StepHarness;
|
| 31 | +import com.diffplug.spotless.StepHarnessWithFile; |
33 | 32 | import com.diffplug.spotless.generic.LicenseHeaderStep.YearMode;
|
34 | 33 |
|
35 | 34 | class LicenseHeaderStepTest extends ResourceHarness {
|
@@ -173,8 +172,8 @@ private String hasHeaderFileName(String license, String fileName) throws IOExcep
|
173 | 172 |
|
174 | 173 | private String hasHeaderYearFileName(String license, String year, String fileName) throws IOException {
|
175 | 174 | return header(license)
|
176 |
| - .replace("$YEAR", year) |
177 |
| - .replace("$FILE", fileName) + getTestResource(FILE_NO_LICENSE); |
| 175 | + .replace("$YEAR", year) |
| 176 | + .replace("$FILE", fileName) + getTestResource(FILE_NO_LICENSE); |
178 | 177 | }
|
179 | 178 |
|
180 | 179 | private static String currentYear() {
|
@@ -269,17 +268,16 @@ void should_preserve_year_for_license_with_address() throws Throwable {
|
269 | 268 | void should_apply_license_containing_filename_token() throws Exception {
|
270 | 269 | FormatterStep step = LicenseHeaderStep.headerDelimiter(header(HEADER_WITH_$FILE), package_).build();
|
271 | 270 | StepHarnessWithFile.forStep(this, step)
|
272 |
| - .test(new File("Test.java"), getTestResource(FILE_NO_LICENSE), hasHeaderFileName(HEADER_WITH_$FILE, "Test.java")); |
| 271 | + .test(new File("Test.java"), getTestResource(FILE_NO_LICENSE), hasHeaderFileName(HEADER_WITH_$FILE, "Test.java")); |
273 | 272 | }
|
274 | 273 |
|
275 | 274 | @Test
|
276 | 275 | void should_apply_license_containing_YEAR_filename_token() throws Exception {
|
277 | 276 | FormatterStep step = LicenseHeaderStep.headerDelimiter(header(HEADER_WITH_$YEAR_$FILE), package_).build();
|
278 | 277 | StepHarnessWithFile.forStep(this, step)
|
279 |
| - .test( |
280 |
| - new File("Test.java"), |
281 |
| - getTestResource(FILE_NO_LICENSE), |
282 |
| - hasHeaderYearFileName(HEADER_WITH_$YEAR_$FILE, currentYear(), "Test.java") |
283 |
| - ); |
| 278 | + .test( |
| 279 | + new File("Test.java"), |
| 280 | + getTestResource(FILE_NO_LICENSE), |
| 281 | + hasHeaderYearFileName(HEADER_WITH_$YEAR_$FILE, currentYear(), "Test.java")); |
284 | 282 | }
|
285 | 283 | }
|
0 commit comments