title: Unsatisfied dependency during test
body: <p>I have a spring boot 2.0.0 M2 application who run well.</p>
  
  <p>I use autowired on constructor</p>
  
  <pre><code>@RequestMapping(value = "/rest")
  @RestController
  public class AddressRestController extends BaseController{
  
      private final AddressService AddressService;
  
      @Autowired
      public AddressRestController(final AddressService AddressService) {
          this.AddressService = AddressService;
      }
      ...
  }
  
  @Service
  public class AddressServiceImpl extends BaseService implements AddressService {
  
      @Autowired
      public AddressServiceImpl(final AddressRepository AddressRepository) {
          this.AddressRepository = AddressRepository;
      }
  
      private final AddressRepository AddressRepository;
      ...
  }
  
  
  public interface AddressRepository extends JpaRepository&lt;Address, Integer&gt;, AddressRepositoryCustom {
  
  }
  
  @Repository
  public class AddressRepositoryImpl extends SimpleJpaRepository implements AddressRepositoryCustom {
      @PersistenceContext
      private EntityManager em;
  
      @Autowired
      public AddressRepositoryImpl(EntityManager em) {
          super(Address.class, em);
      }
      ...
  }
  </code></pre>
  
  <p>When i try to run a basic test</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  public class AddressServiceTest {
  
      @Autowired
      private AddressService service;
  
      @MockBean
      private AddressRepository restTemplate; 
  
      @Test
      public void getAddress(){
  
          MockitoAnnotations.initMocks(this);
  
          Pageable page = PageRequest.of(0, 20);
  
          Page&lt;Address&gt; pageAdr = mock(Page.class);
  
          given(this.restTemplate.findAll(page)).willReturn(pageAdr);
  
          Page&lt;AddressDto&gt; pageDto = service.getAddress(page);
  
      }
  }
  </code></pre>
  
  <p>I get this error</p>
  
  <blockquote>
    <p>org.springframework.beans.factory.UnsatisfiedDependencyException:
    Error creating bean with name
    'com.sonos.arcor.service.AddressServiceTest': Unsatisfied dependency
    expressed through field 'service'; nested exception is
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No
    qualifying bean of type ''com.sonos.arcor.service.AddressService'
    available: expected at least 1 bean which qualifies as autowire
    candidate. Dependency annotations:
    {@org.springframework.beans.factory.annotation.Autowired(required=true)}</p>
  </blockquote>
  
  <p>I don't understand why i get this error.</p>