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 ).assertOk();
32 }
33
34 static Collection<String[]> parameters() {
35 return Arrays.asList(
36 new String[][] {
37 {"UseConcurrentHashMap"},
38 {"DoNotUseThreads"},
39 {"AvoidUsingVolatile"},
40 {"DefaultPackage"},
41 {"ExcessiveImports"},
42 {"PositionLiteralsFirstInComparisons"},
43 {"MissingSerialVersionUID"},
44 {"CallSuperInConstructor"},
45 {"UnnecessaryVarargsArrayCreation"},
46 {"ShortMethodName"},
47 {"AvoidFieldNameMatchingMethodName"},
48 }
49 );
50 }
51 }