Dmitry Timofeev created SUREFIRE-1720:
-----------------------------------------

             Summary: JUnit 5 @Nested classes are not excluded when name ends 
in Tests
                 Key: SUREFIRE-1720
                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1720
             Project: Maven Surefire
          Issue Type: Bug
    Affects Versions: 3.0.0-M3, 2.22.2
            Reporter: Dmitry Timofeev


{color:#808080}`<exclude>` {color}over source file names does not exclude the 
{color:#808080}`@Nested` {color}test classes, defined inside the matching 
source files, if they end with {color:#808080}`Tests`{color}.
h3. Minimal reproducing project

[https://github.com/dmitry-timofeev/surefire-bug] (contains the instrutctions 
to run)

See AppIntegrationTest.
h3. Surefire Configuration
{code:java}
<plugin>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>${surefire.version}</version>
  <configuration>
    <excludes>
      <!-- (1) Such syntax operates on source file names, according to the docs:
           
https://maven.apache.org/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html
           but does not exclude the JUnit 5 @Nested classes, defined in 
*matching* files. -->
      <exclude>**/*IntegrationTest.java</exclude>
<!--              (2) Regex-syntax operates on classes, according to the docs;
           and excludes the @Nested classes properly: -->
<!--              <exclude>%regex[.*IntegrationTest\$.*]</exclude>-->
    </excludes>
  </configuration>
</plugin>
{code}
h3. {color:#9876aa}Expected Behaviour{color}

When a pattern over source file names is used 
({color:#808080}`<exclude>*Pattern.java<exclude>`{color}),
it must apply to all classes inside that file (including @Nested with any name).
h3. {color:#9876aa}Actual Behaviour{color}

The exclusion does not apply to some @Nested classes inside the matching source 
file (e.g, ending with {color:#808080}`Tests`{color}).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to