@@ -268,7 +268,18 @@ void should_preserve_year_for_license_with_address() throws Throwable {
268
268
void should_apply_license_containing_filename_token () throws Exception {
269
269
FormatterStep step = LicenseHeaderStep .headerDelimiter (header (HEADER_WITH_$FILE ), package_ ).build ();
270
270
StepHarnessWithFile .forStep (this , step )
271
- .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" ))
272
+ .testUnaffected (new File ("Test.java" ), hasHeaderFileName (HEADER_WITH_$FILE , "Test.java" ));
273
+ }
274
+
275
+ @ Test
276
+ void should_update_license_containing_filename_token () throws Exception {
277
+ FormatterStep step = LicenseHeaderStep .headerDelimiter (header (HEADER_WITH_$FILE ), package_ ).build ();
278
+ StepHarnessWithFile .forStep (this , step )
279
+ .test (
280
+ new File ("After.java" ),
281
+ hasHeaderFileName (HEADER_WITH_$FILE , "Before.java" ),
282
+ hasHeaderFileName (HEADER_WITH_$FILE , "After.java" ));
272
283
}
273
284
274
285
@ Test
@@ -278,6 +289,9 @@ void should_apply_license_containing_YEAR_filename_token() throws Exception {
278
289
.test (
279
290
new File ("Test.java" ),
280
291
getTestResource (FILE_NO_LICENSE ),
292
+ hasHeaderYearFileName (HEADER_WITH_$YEAR_$FILE , currentYear (), "Test.java" ))
293
+ .testUnaffected (
294
+ new File ("Test.java" ),
281
295
hasHeaderYearFileName (HEADER_WITH_$YEAR_$FILE , currentYear (), "Test.java" ));
282
296
}
283
297
}
0 commit comments