Skip to content

Commit a60091c

Browse files
committedSep 30, 2021
#1097 pmd works
1 parent 135d33c commit a60091c

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed
 

‎qulice-pmd/src/test/java/com/qulice/pmd/PmdDisabledRulesTest.java

+7-22
Original file line numberDiff line numberDiff line change
@@ -32,35 +32,19 @@
3232
import java.util.Arrays;
3333
import java.util.Collection;
3434
import org.hamcrest.Matchers;
35-
import org.junit.Test;
36-
import org.junit.runner.RunWith;
37-
import org.junit.runners.Parameterized;
35+
import org.junit.jupiter.params.ParameterizedTest;
36+
import org.junit.jupiter.params.provider.MethodSource;
3837

3938
/**
4039
* Tests for disabled rules.
4140
* @since 0.16
4241
*/
43-
@RunWith(Parameterized.class)
4442
public final class PmdDisabledRulesTest {
4543

46-
/**
47-
* Disabled rule name.
48-
*/
49-
private final String rule;
50-
51-
/**
52-
* Constructor.
53-
* @param rule Disabled rule name.
54-
*/
55-
public PmdDisabledRulesTest(final String rule) {
56-
this.rule = rule;
57-
}
58-
5944
/**
6045
* Collection of disabled rules.
6146
* @return Collection of disabled rules.
6247
*/
63-
@Parameterized.Parameters
6448
public static Collection<String[]> parameters() {
6549
return Arrays.asList(
6650
new String[][] {
@@ -80,14 +64,15 @@ public static Collection<String[]> parameters() {
8064
* PmdValidator has rules disabled.
8165
* @throws Exception In case of error.
8266
*/
83-
@Test
84-
public void disablesRules() throws Exception {
67+
@ParameterizedTest
68+
@MethodSource("parameters")
69+
public void disablesRules(final String rule) throws Exception {
8570
new PmdAssert(
86-
String.format("%s.java", this.rule),
71+
String.format("%s.java", rule),
8772
Matchers.any(Boolean.class),
8873
Matchers.not(
8974
Matchers.containsString(
90-
String.format("(%s)", this.rule)
75+
String.format("(%s)", rule)
9176
)
9277
)
9378
).validate();

0 commit comments

Comments
 (0)
Please sign in to comment.