File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 4242import org .hamcrest .core .IsEqual ;
4343import org .hamcrest .core .IsNot ;
4444import org .junit .jupiter .api .Test ;
45+ import org .junit .jupiter .api .condition .EnabledForJreRange ;
46+ import org .junit .jupiter .api .condition .JRE ;
4547
4648/**
4749 * Test case for {@link PmdValidator} class.
@@ -716,4 +718,20 @@ void allowJunitTestClassToBeFinal() throws Exception {
716718 )
717719 ).validate ();
718720 }
721+
722+ /**
723+ * PmdValidator can allow record classes.
724+ * @throws Exception If something wrong happens inside.
725+ */
726+ @ Test
727+ @ EnabledForJreRange (min = JRE .JAVA_14 , max = JRE .JAVA_21 )
728+ void allowRecordClasses () throws Exception {
729+ new PmdAssert (
730+ "RecordParsed.java" ,
731+ Matchers .is (true ),
732+ Matchers .not (
733+ Matchers .containsString (PmdValidatorTest .STATIC_METHODS )
734+ )
735+ ).validate ();
736+ }
719737}
Original file line number Diff line number Diff line change 1+ package foo ;
2+
3+ public record RecordParsed (
4+ Object symbol ,
5+ int line ,
6+ String msg
7+ ) {
8+ }
You can’t perform that action at this time.
0 commit comments