Code inspections do not seem to recognize Spring @Autowired and Mockito @Mock fields
I have a spring boot project that I am developing in Intellij 2017 and building with TC 10.0.5.
I would like to run all of the intellij inspections to ensure that we have no additional issues during the build process. So far, I have two issues:
- It appears the the inspections running in TC do not have the context to know that it is a spring boot app or mockito test.
- The inspection process seems to take 2-2.5m to run.
Here are some examples of an errors:
27: imageProcessor Declaration can have final modifier
@Mock
private ImageProcessor imageProcessor;
13: foregroundQueueCapacity Declaration can have final modifier
@Value("${resize-queue.foreground.capacity}")
private int foregroundQueueCapacity;
Both of these are issues that would render this ineffective. I'm guessing that I just don't have things configured quite right. I've tried using both a gradle and intellij project as the root for this.
My .idea directory has the following files checked in:
- modules
- >> image-proxy.iml
- >> image-proxy_main.iml
- >> image-proxy_test.iml
- codeStyleSettings.xml
- compiler.cml
- encoding.xml
- gradle.xml
- misc.xml
- modules.xml
- saveactions_settings.xml
- vcs.xml
Regarding the second speed issue, is this the performance that others are seeing?
Please sign in to leave a comment.
Does anyone have any thoughts on this?
It's been quite frustrating to not have this work as I would have thought it would.
I did notice this warning:
This would suggest that the facet that IntelliJ finds when loading, isn't loading correctly when TeamCity is loading it.