Improve architecture test.
@@ -6,6 +6,7 @@ import org.apache.commons.digester3.Digester;
import org.apache.commons.digester3.binder.DigesterLoader;
import org.xml.sax.XMLReader;
+import com.tngtech.archunit.core.domain.JavaModifier;
import com.tngtech.archunit.junit.AnalyzeClasses;
import com.tngtech.archunit.junit.ArchTest;
import com.tngtech.archunit.lang.ArchRule;
@@ -31,7 +32,12 @@ class PluginArchitectureTest {
static final ArchRule NO_JENKINS_INSTANCE_CALL = PluginArchitectureRules.NO_JENKINS_INSTANCE_CALL;
@ArchTest
- static final ArchRule NO_PUBLIC_TEST_CLASSES = PluginArchitectureRules.NO_PUBLIC_TEST_CLASSES;
+ static final ArchRule NO_PUBLIC_TEST_CLASSES =
+ noClasses().that().haveSimpleNameEndingWith("Test")
+ .and().haveSimpleNameNotContaining("_jmh")
+ .and().doNotHaveModifier(JavaModifier.ABSTRACT)
+ .and().haveSimpleNameNotEndingWith("ITest")
+ .should().bePublic();
@ArchTest
static final ArchRule NO_TEST_API_CALLED = ArchitectureRules.NO_TEST_API_CALLED;
