ArchUnit icon indicating copy to clipboard operation
ArchUnit copied to clipboard

ArchTest on fields does not run under Maven Surefire Plugin 3.5.3+

Open erwanosouf opened this issue 6 months ago • 6 comments

There is a bug when running ArchUnit test using ArchTest on a ArchRule field.

It works under Maven Surefire Plugin 3.5.2 but not 3.5.3

Note that ArchTest set on methods work.

I have created a repo demonstrating the issue. Refer to the Readme for reproduction instruction

Description This repository contains a Test Case to exhibit a behavior that appeared in Surefire 3.5.3.

A Junit5 Test Class ArchUnitSurefireBugTest contains 3 tests

thisTestUsingArchTestFieldShouldRun : A Test using @ ArchTest on a field thisTestUsingArchTestMethodShouldRun : A Test using @ ArchTest on a method thisStandardTestShouldRun : a standard JUnit Test using no ArchUnit syntactic sugar. Expected Run mvn test -Dsurefire.version=3.5.2 -f pom.xml

All tests run

Actual mvn test -Dsurefire.version=3.5.3 -f pom.xml

thisTestUsingArchTestFieldShouldRun does not run.

erwanosouf avatar Apr 03 '25 12:04 erwanosouf