diff --git a/src/test/java/fr/xephi/authme/CodeClimateConfigTest.java b/src/test/java/fr/xephi/authme/CodeClimateConfigTest.java index 76d37872..bcf2f1af 100644 --- a/src/test/java/fr/xephi/authme/CodeClimateConfigTest.java +++ b/src/test/java/fr/xephi/authme/CodeClimateConfigTest.java @@ -8,6 +8,7 @@ import java.io.File; import java.util.List; import static org.hamcrest.Matchers.empty; +import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; @@ -27,6 +28,7 @@ public class CodeClimateConfigTest { // then assertThat(excludePaths, not(empty())); + removeTestsExclusionOrThrow(excludePaths); for (String path : excludePaths) { verifySourceFileExists(path); } @@ -45,4 +47,10 @@ public class CodeClimateConfigTest { fail("Path '" + path + "' does not exist!"); } } + + private static void removeTestsExclusionOrThrow(List excludePaths) { + boolean wasRemoved = excludePaths.removeIf("src/test/java/**Test.java"::equals); + assertThat("Expected an exclusion for test classes", + wasRemoved, equalTo(true)); + } }