title: IntelliJ and Spring boot test: unresolved bean, could not autowire
body: <p>I have got a gradle imported project in IntelliJ, kotlin. Compilations go fine, tests are run fine both via command line and via IntelliJ. The only thing I'd like gone is the red error highlighting saying e.g. &quot;Could not autowire. No beans of 'FooRepository' type found&quot;. The weird part is that I've got exact same setup in another PC and there it works fine. Using IntelliJ <code>2021.1</code> on Ubuntu. I can't recall this in the previous versions.</p>
  <p><a href="https://i.stack.imgur.com/oc5rv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oc5rv.png" alt="enter image description here" /></a></p>
  <p>The <code>FooRepository</code> is declared with <code>@Repository</code> annotation, like this:</p>
  <pre><code>@Repository
  class FooTypeRepository(
      @Autowired var jdbcTemplate: NamedParameterJdbcTemplate
  ){...}
  </code></pre>