Skip to content

Discovery reports annotation types meta-annotated with @Nested declared in test classes as "must not be static" #4681

@odrotbohm

Description

@odrotbohm

Steps to reproduce

For a test class containing an annotation that's nested and annotated with @Nested, the annotation type is reported as “must not be static”. This doesn't make sense, as nested annotation types are implicitly static.

Source type can be found here.

Output:

[WARNING] [stderr] WARNING: TestEngine with ID 'junit-jupiter' encountered 7 non-critical issues during test discovery:
[WARNING] [stderr] 
[WARNING] [stderr] (1) [WARNING] @Nested class 'org.springframework.modulith.events.jdbc.JdbcEventPublicationRepositoryIntegrationTests$WithOracle' must not be static. It will not be executed.
[WARNING] [stderr]     Source: ClassSource [className = 'org.springframework.modulith.events.jdbc.JdbcEventPublicationRepositoryIntegrationTests$WithOracle', filePosition = null]
[WARNING] [stderr]             at org.springframework.modulith.events.jdbc.JdbcEventPublicationRepositoryIntegrationTests$WithOracle.<no-method>(SourceFile:0)

Context

  • Used versions (Jupiter/Vintage/Platform): 5.13.1
  • Build Tool/IDE: Maven, STS

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions