View Javadoc
1   package com.atlassian.plugin.spring.scanner.test.primary;
2   
3   import org.springframework.beans.factory.annotation.Autowired;
4   import org.springframework.stereotype.Component;
5   
6   import static java.lang.String.format;
7   
8   @Component
9   public class ConsumingPrimaryComponentByInterface {
10  
11      @Autowired
12      ConsumingPrimaryComponentByInterface(ComponentInterfaceWithAPrimaryImplementation component) {
13          if (!(component instanceof PrimaryImplementation)) {
14              throw new IllegalStateException(format("The bean autowired for ComponentInterfaceWithAPrimaryImplementation was not an instance of PrimaryImplementation, instead it was %s", component.getClass().getName()));
15          }
16      }
17  
18  }