title: MapStruct mapper not injected in Spring Unit Tests
body: <p>I'm using one mapper generated with MapStruct:</p>
  
  <pre><code>@Mapper
  public interface CustomerMapper {
     Customer mapBankCustomerToCustomer(BankCustomerData bankCustomer);
  }
  </code></pre>
  
  <p>The default component model is spring (set in pom.xml)</p>
  
  <pre><code>&lt;compilerArg&gt;-Amapstruct.defaultComponentModel=spring&lt;/compilerArg&gt;
  </code></pre>
  
  <p>I have a service in which I inject the customer mapper and works fine when I run the application</p>
  
  <pre><code>@Autowired
  private CustomerMapper customerMapper;
  </code></pre>
  
  <p>But when I run unit tests that involves @SpringBootTest</p>
  
  <pre><code>@SpringBootTest
  @AutoConfigureMockMvc
  @RunWith(SpringRunner.class)
  public class SomeControllerTest {
  
      @Mock
      private SomeDependency someDependency;
  
      @InjectMocks
      private SomeController someController;
  
      @Test
      public void shouldDoSomething() {
          ...
      }
  
  }
  </code></pre>
  
  <p>I get an org.springframework.beans.factory.UnsatisfiedDependencyException</p>
  
  <blockquote>
    <p>Unsatisfied dependency expressed through field 'customerMapper'</p>
  </blockquote>