Skip to content

Commit e7dc3a6

Browse files
committed
Merge branch '__rultor'
2 parents 130d14d + 2fcfc77 commit e7dc3a6

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

qulice-pmd/src/test/java/com/qulice/pmd/PmdValidatorTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
import org.hamcrest.core.IsEqual;
4343
import org.hamcrest.core.IsNot;
4444
import 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
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package foo;
2+
3+
public record RecordParsed(
4+
Object symbol,
5+
int line,
6+
String msg
7+
) {
8+
}

0 commit comments

Comments
 (0)