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 PmdEnabledRulesTest {
19
20 @ParameterizedTest
21 @MethodSource("parameters")
22 void enablesRules(final String rule) throws Exception {
23 new PmdAssert(
24 String.format("%s.java", rule),
25 Matchers.is(false),
26 Matchers.containsString(String.format("(%s)", rule))
27 ).assertOk();
28 }
29
30 static Collection<String[]> parameters() {
31 return Arrays.asList(
32 new String[][] {
33 {"HardCodedCryptoKey"},
34 {"InsecureCryptoIv"},
35 {"LiteralsFirstInComparisons"},
36 {"UseDiamondOperator"},
37 {"LinguisticNaming"},
38 {"NonSerializableClass"},
39 }
40 );
41 }
42 }