diff --git a/.ci/pitest.sh b/.ci/pitest.sh
index 6024d33a2804..90e1f8ae40f8 100755
--- a/.ci/pitest.sh
+++ b/.ci/pitest.sh
@@ -71,7 +71,6 @@ pitest-header)
pitest-imports)
mvn -e -P$1 clean test org.pitest:pitest-maven:mutationCoverage;
declare -a ignoredItems=(
- "AvoidStarImportCheck.java.html:
&& ast.getType() == TokenTypes.STATIC_IMPORT) { | "
"AvoidStarImportCheck.java.html: if (exclude.endsWith(STAR_IMPORT_SUFFIX)) { | "
"CustomImportOrderCheck.java.html: else if (customImportOrderRules.contains(SAME_PACKAGE_RULE_GROUP)) { | "
"CustomImportOrderCheck.java.html: if (bestMatch.group.equals(NON_GROUP_RULE_GROUP)) { | "
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStarImportCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStarImportCheckTest.java
index b96a8b5e1851..2a7333374b92 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStarImportCheckTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStarImportCheckTest.java
@@ -95,6 +95,22 @@ public void testAllowStaticMemberImports() throws Exception {
verify(checkConfig, getPath("InputAvoidStarImportDefault.java"), expected2);
}
+ @Test
+ public void testDenyStaticMemberImports() throws Exception {
+ final DefaultConfiguration checkConfig = createModuleConfig(AvoidStarImportCheck.class);
+ checkConfig.addAttribute("allowStaticMemberImports", "false");
+ // deny all static star imports
+ final String[] expected2 = {
+ "7: " + getCheckMessage(MSG_KEY, "com.puppycrawl.tools.checkstyle.checks.imports.*"),
+ "9: " + getCheckMessage(MSG_KEY, "java.io.*"),
+ "10: " + getCheckMessage(MSG_KEY, "java.lang.*"),
+ "25: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"),
+ "26: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"),
+ "28: " + getCheckMessage(MSG_KEY, "java.io.File.*"),
+ };
+ verify(checkConfig, getPath("InputAvoidStarImportDefault.java"), expected2);
+ }
+
@Test
public void testGetAcceptableTokens() {
final AvoidStarImportCheck testCheckObject =