In my current code base I'm working on we have
//Config.java
@Bean
@Profile(ProfileRegistry.LOCAL_OR_TEST)
public ApvcBlobClient apvcLocalAzureBlobClient() {
return new LocalApvcBlobClient();
}
// LocalApvcBlobClient.java
public class LocalApvcBlobClient extends LocalBlobClient implements ApvcBlobClient {
}
//test folder / SpringTest.java
@Autowired
LocalApvcBlobClient apvcBlobClient;
I know you can inject more concrete implementations into higher interfaces. Which would mean I can inject a LocalApvcBlobClient bean into a ApvcBlobClient variable. But the current code does does not have any bean for the LocalApvcBlobClient implementation. What confuses me is, that IntelliJ shows an error Could not autowire. No beans of 'LocalApvcBlobClient' type found. and thus cant navigate to the bean. Does this mean, spring looks at the returned object type instead of the declared method return type to determine in what this can be injected?