Skip to content

Commit

Permalink
Bump plugin utils API (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsandell authored Dec 14, 2022
1 parent 2464f17 commit 3c379ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>

<testcontainers.version>1.17.6</testcontainers.version>
<plugin-util-api.version>2.20.0</plugin-util-api.version>
</properties>

<licenses>
Expand All @@ -44,10 +45,12 @@
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>plugin-util-api</artifactId>
<version>${plugin-util-api.version}</version>
</dependency>
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>plugin-util-api</artifactId>
<version>${plugin-util-api.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
Expand Down
11 changes: 8 additions & 3 deletions src/test/java/io/jenkins/plugins/checks/ArchitectureTest.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package io.jenkins.plugins.checks;

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;
import com.tngtech.archunit.lang.syntax.elements.ClassesShouldConjunction;
import com.tngtech.archunit.lang.syntax.ArchRuleDefinition;
import edu.hm.hafner.util.ArchitectureRules;
import io.jenkins.plugins.util.PluginArchitectureRules;
import org.junit.runner.RunWith;
Expand All @@ -20,8 +21,12 @@ class ArchitectureTest {
static final ArchRule NO_JENKINS_INSTANCE_CALL = PluginArchitectureRules.NO_JENKINS_INSTANCE_CALL;

@ArchTest
static final ArchRule NO_PUBLIC_TEST_CLASSES = ((ClassesShouldConjunction) ArchitectureRules.NO_PUBLIC_TEST_CLASSES)
.andShould().notBeAnnotatedWith(RunWith.class); // Allow for JUnit4 tests.
static final ArchRule NO_PUBLIC_TEST_CLASSES = ArchRuleDefinition.noClasses()
.that().haveSimpleNameEndingWith("Test")
.and().haveSimpleNameNotContaining("_jmh")
.and().doNotHaveModifier(JavaModifier.ABSTRACT).should().bePublic()
.andShould().notBeAnnotatedWith(RunWith.class)
.because("test classes are not part of the API and should be hidden in a package");

@ArchTest
static final ArchRule NO_TEST_API_CALLED = ArchitectureRules.NO_TEST_API_CALLED;
Expand Down

0 comments on commit 3c379ba

Please sign in to comment.