Should SystemPropertyExtension use closest or enclosing annotations
See original GitHub issueIn stream and while discussing (the already merged) #187 we were thinking about following thing:
At the moment the SystemPropertyExtension
only looks for the closest
annotation. When @nicolaiparlog was doing #187 he kept it that way to keep the tests passing, but we both asked ourself if that’s the correct way the extension should work or if it should also take the enclosing
annotations into account.
Note: The current docs say to only use closest
, but of course they “only” fit to current implementation.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Reduce duplication · Issue #180 · junit-pioneer/junit ... - GitHub
EnvironmentVariableExtension and SystemPropertyExtension are basically ... Should SystemPropertyExtension use closest or enclosing annotations #222.
Read more >index all classes all packages - junit-pioneer 1.9.1 javadoc
The boolean values to use as sources of arguments; must not be empty. ... findClosestEnclosingRepeatableAnnotations(ExtensionContext, Class<A>) - Static ...
Read more >Properly set (system) properties in JUnit 5 - Stack Overflow
Both annotations work on the test method and class level, are repeatable as well as combinable. After the annotated method has been executed, ......
Read more >JUnit 5 User Guide
The default orderer will be used for all tests unless the @TestMethodOrder annotation is present on an enclosing test class or test interface....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This also effects
EnvironmentVariableExtension
because both extensions should probably operate equally in that regards #180AbstractEntryBasedExtension
probably should serve as a central place to control the annotation processing, like I said here:This way, we get consistent behavior for all subclasses such as
SystemPropertyExtension
andEnvironmentVariableExtension
.I am not sure if I would go for stuff like
@IgnoreSetOrClearSystemProperty
. This can make things really complicated, both from a maintainer and a user perspective. And one can easily achieve the desired behavior with what we already have.I would suggest to look into similar extensions in Jupiter and—if applicable—try to copy their behavior, such that users get consistent behavior across the JUnit universe.
Thoughts?