title: How to autowire different services depending on environment in spring mvc?
body: <p>I have a service with an interface that is Autowired by spring. I now wish to autowire an other service if the production environment is development. How would I go about doing this?.</p>
  
  <p>The inteface looks like this.</p>
  
  <pre><code>public interface ClientServiceInterface {
  
    public User getUser(String ID);
  
    public List&lt;User&gt; getUsersByDepartment(String department) 
  
    public void initialize();
  
  }
  </code></pre>
  
  <p>The interface is implemented by ClientMockServiceImpl and ClientServiceImpl. I Wish to use the mock service in development. Both classes use the @Service annotation. I wish that my autowiring of the service would change depending on prod env.</p>
  
  <p>Please advice. Thank you.</p>