1
2
3
4
5 package com.qulice.pmd;
6
7 import java.util.Arrays;
8 import java.util.Collection;
9 import org.hamcrest.Matchers;
10 import org.junit.jupiter.params.ParameterizedTest;
11 import org.junit.jupiter.params.provider.MethodSource;
12
13
14
15
16
17
18 final class PmdDisabledRulesTest {
19
20 @ParameterizedTest
21 @MethodSource("parameters")
22 void disablesRules(final String rule) throws Exception {
23 new PmdAssert(
24 String.format("%s.java", rule),
25 Matchers.any(Boolean.class),
26 Matchers.not(
27 Matchers.containsString(
28 String.format("(%s)", rule)
29 )
30 )
31 ).validate();
32 }
33
34 @SuppressWarnings("PMD.ProhibitPublicStaticMethods")
35 public static Collection<String[]> parameters() {
36 return Arrays.asList(
37 new String[][] {
38 {"UseConcurrentHashMap"},
39 {"DoNotUseThreads"},
40 {"AvoidUsingVolatile"},
41 {"DefaultPackage"},
42 {"ExcessiveImports"},
43 {"PositionLiteralsFirstInComparisons"},
44 {"MissingSerialVersionUID"},
45 {"CallSuperInConstructor"},
46 }
47 );
48 }
49
50 }