I have the following bean configuration for a non-web application
@Configuration
public class MyBeans {
@Bean
@Scope(value="prototype")
MyObject myObject() {
return new MyObjectImpl();
}
}
On the other hand, I have a class
public class MyCommand implements Command {
@Autowired
private MyObject myObject;
[...]
}
How can I do myCommand automatically with customization in MyBeans without using XML so that I can inject mocks into other test classes?
Thank you very much in advance.
source
share