hosuaby / inject-resources

Simple and convenient way to read content of resource in Java.
http://inject-resources.hosuaby.io
Apache License 2.0
54 stars 5 forks source link

[Junit5] Injection of named parsers fail before checking TestsAdvice #23

Closed DenWav closed 3 months ago

DenWav commented 1 year ago

When using a global @TestsAdvice with a named parsers, the injection of the named parser will always fail before TestWithResourcesExtension checks for the presence of a With<Parser> member in a tests advice class.

The error that no parser of the given name can be found occurs here: https://github.com/hosuaby/inject-resources/blob/b7416cbcb5f99b45fdc4acf80b3522e528a8c342/inject-resources-junit-jupiter/src/main/java/com/adelean/inject/resources/junit/jupiter/TestWithResourcesExtension.java#L43

But TestsAdviceProcessor is not called until after that: https://github.com/hosuaby/inject-resources/blob/b7416cbcb5f99b45fdc4acf80b3522e528a8c342/inject-resources-junit-jupiter/src/main/java/com/adelean/inject/resources/junit/jupiter/TestWithResourcesExtension.java#L45-L50

hosuaby commented 3 months ago

Fixed in 0.3.4