Skip to content

Commit 5d04f1d

Browse files
rnveachmuhlba91
authored andcommitted
supplemental: resolve checkstyle violations from expanded search #444
1 parent a48beaa commit 5d04f1d

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

config/sevntu_suppressions.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222

2323
<!-- Tone down the checking for test code -->
24+
<suppress checks="MultipleStringLiteralsExtended" files=".*[\\/]src[\\/]it[\\/]"/>
2425
<suppress checks="MultipleStringLiteralsExtended" files=".*[\\/]src[\\/]test[\\/]"/>
2526
<suppress checks="ForbidCCommentsInMethods" files=".*[\\/]src[\\/]test[\\/]"/>
27+
<suppress checks="AvoidModifiersForTypes" files=".*[\\/]src[\\/]it[\\/]"/>
2628
</suppressions>

src/it/java/org/checkstyle/plugins/sonar/RunPluginTest.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,9 @@ public static void afterAll() {
103103
}
104104

105105
@Test
106-
public void testSonarExecution() {
107-
try {
108-
final MavenBuild build = testProjectBuild();
109-
executeBuildWithCommonProperties(build, true);
110-
}
111-
catch (IOException exception) {
112-
LOG.error("Build execution error.", exception);
113-
fail("Failed to execute build.");
114-
}
106+
public void testSonarExecution() throws IOException {
107+
final MavenBuild build = testProjectBuild();
108+
executeBuildWithCommonProperties(build, true);
115109
}
116110

117111
private static void executeBuildWithCommonProperties(Build<?> build, boolean buildQuietly)

src/test/java/org/sonar/plugins/checkstyle/CheckstyleRulesDefinitionTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.HashMap;
2525
import java.util.List;
2626
import java.util.Map;
27+
import java.util.Map.Entry;
2728
import java.util.stream.Collectors;
2829

2930
import org.junit.Rule;
@@ -71,11 +72,11 @@ public void test() {
7172
});
7273
final List<String> duplicatedRuleWithTemplate = ruleCounts.entrySet().stream()
7374
.filter(entry -> entry.getValue() > 1)
74-
.map(entry -> entry.getKey())
75+
.map(Entry::getKey)
7576
.collect(Collectors.toList());
7677
final List<String> rulesWithDuplicateTemplate = ruleCounts.entrySet().stream()
7778
.filter(entry -> entry.getValue() == 1)
78-
.map(entry -> entry.getKey())
79+
.map(Entry::getKey)
7980
.collect(Collectors.toList());
8081
// such number should not change during checkstyle version upgrade
8182
assertThat(duplicatedRuleWithTemplate).hasSize(0);

0 commit comments

Comments
 (0)