IntelliJ offers a very intelligent experience by giving you such a relevant suggestion in every context. However, in some parts, you need to configure them.
Our project / product are maven-based and we used spring framework. The spring configuration is in XML file. We discover that IntelliJ unable to refer to property or annotated beans that you declared under test/resources directory. Note that this is not happen to the configs file under src/resources. For example, you’ll see a warning on ${db.dev.url} which tells you the key cannot be resolved.
Solution
For quick fix, what you can do is to include all your spring configs under test directory in your IntelliJ project structure.
- Open project structure (CTRL + ALT + SHIFT + S) in on windows
- Under project settings, select Modules
- Select a module and add Spring
- Add new application context
- Select XML based configurations
- Locate your spring configuration files.
- Done