-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
propertySources attribute behavior in @MicronautTest is confusing #401
Comments
If the value has to be prefixed with |
Sorry... I understand now. It would be a breaking change, but it wouldn't prevent folks from using a relative path. |
I don't think this behavior should be removed or changed, however the documentation should instead show as an example the more common use case of Also we should throw an error, or at least a warning when the file is not found |
@jameskleeh My suggestion is intended to make the behavior consistent and intuitive. May be some people don’t need relative classpath, but that’s what is happening today without the prefix. Wouldn’t it be nice if both prefixes work the same way? |
I'm not sure what you mean here. There are 2 prefixes,
Having |
This currently is absolute compared to |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Task List
Actual Behaviour
Given the project structure above, and
@MicronautTest(propertySources = ["persistence.yml"])
,ProjectRepositoryTest
fails with the following exception:Upon chatting on Gitter with @jameskleeh, turned out this is due to the fact that the file
persistence.yml
is searched for relative to the test class in the same package. No warning is logged when it's not found.Tell us what should happen
propertySources
should always be prefixed with eitherclasspath
orfile
. If a path starts with/
, it's considered to be from the root of the classpath or file system, otherwise relative to the test class.Better yet, deprecate
propertySources
in favor of micronaut-projects/micronaut-core#5176.The text was updated successfully, but these errors were encountered: