title: XML-less configuration for spring
body: <p>I have the following configuration bean for a non web app </p>
  
  <pre><code>@Configuration
  public class MyBeans {
  
      @Bean
      @Scope(value="prototype")
      MyObject myObject() {
          return new MyObjectImpl();
      }
  }
  </code></pre>
  
  <p>On the other side I have my class</p>
  
  <pre><code>public class MyCommand implements Command {
  
    @Autowired
    private MyObject myObject;
  
    [...]
  
  }
  </code></pre>
  
  <p>How can I make myCommand be autowired with the configuration in MyBeans without using XML so I can inject mocks in my other test classes?</p>
  
  <p>Thanks a lot in advance.</p>