From c37c0ce436d74e3886190ba2092cd25ed792000b Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 21 Oct 2017 19:55:56 +0200 Subject: [PATCH] Fix CodeClimate config test to account for new test exclusion entry --- src/test/java/fr/xephi/authme/CodeClimateConfigTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/java/fr/xephi/authme/CodeClimateConfigTest.java b/src/test/java/fr/xephi/authme/CodeClimateConfigTest.java index 76d378727..bcf2f1af0 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)); + } }