Skip to content

Commit

Permalink
(applications) Checkstyle rule to prevent use of junit4
Browse files Browse the repository at this point in the history
  • Loading branch information
murdos committed Oct 27, 2023
1 parent 164b260 commit 175939c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@
<module name="TreeWalker">
<module name="RedundantImport" />
<module name="UnusedImports" />
<module name="IllegalImport">
<property name="regexp" value="true"/>
<!-- Reject any org.junit import that's not also org.junit.jupiter: -->
<property name="illegalClasses" value="^org\.junit\.(?!jupiter\.)(?!platform\.).+"/>
</module>
</module>
</module>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package tech.jhipster.lite.generator.server.javatool.checkstyle.domain;

import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.*;
import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.assertThatModuleWithFiles;
import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.pomFile;

import org.junit.jupiter.api.Test;
import tech.jhipster.lite.TestFileUtils;
Expand Down Expand Up @@ -49,6 +50,7 @@ void shouldBuildModule() {
)
.and()
.hasFile("checkstyle.xml")
.containing("<module name=\"IllegalImport\">")
.containing("<module name=\"Checker\">")
.containing("<module name=\"TreeWalker\">")
.containing("<module name=\"UnusedImports\" />");
Expand Down

0 comments on commit 175939c

Please sign in to comment.