title: Mocking a service within service (JUnit)
body: <p>I have the following service:</p>
  
  <pre><code>@Service
  public class PlayerValidationService {
  
  @Autowire
  private EmailService emailService;
  
  
  public boolean validatePlayerEmail(Player player) {
      return this.emailService.validateEmail(player.getEmail());
  
  }
  </code></pre>
  
  <p>Now in my junit test class i'm using a different 3rd service that uses PlayerValidationService :</p>
  
  <pre><code>public class junit {
  @autowire PlayerAccountService playerAccountService ;
  
  
  @Test
  public test() {
       this.playerAccountService .createAccount();
       assertAllSortsOfThings();
  }
  </code></pre>
  
  <p>Is it possible to mock the EmailService  within the PlayerAccountService when using annotation based autowiring?  (for example make the mock not checking the validation of the email via the regular email provider we work with)</p>
  
  <p>thanks.</p>