alturkovic
alturkovic

Reputation: 1140

IntelliJ IDEA always shows MockitoAopProxyTargetInterceptor as autowired

Every @Bean has the autowired icon in the gutter in IntelliJ IDEA and when I click on it to see what is autowired it always shows Mockito as autowired.

enter image description here

I'm not sure why it's happening, did I misconfigure something? How can I tell IntelliJ IDEA not to show MockitoAopProxyTargetInterceptor as autowired?

Upvotes: 0

Views: 72

Answers (1)

CrazyCoder
CrazyCoder

Reputation: 402433

The signature of the method in MockitoAopProxyTargetInterceptor is:

@Autowired public static void applyTo(Object source) {}

We have beans (annotated with @Bean) and places where they are used. This icon is the navigation to such places.

As the type of the source parameter is Object, every @Bean will be associated with this place and will have navigation usage to this applyTo() method.

What can we do:

  1. Don't show navigation to autowired injection points of Object type
  2. Reduce search scope (don't search in test-library scope where Mockito is placed)

I've created the request for this: IDEA-172429. Please follow for updates.

Upvotes: 2

Related Questions