I want to make fun of a DAO bean using Springockito in one of my IT. In my IT, I have to use spring context.xml to autosave some services, as well as mockApplication.xml to mock DAO. So how can I use both xml configuration files at the same time?
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(loader = SpringockitoContextLoader.class, locations = {"classpath*:/MockApplicationContext.xml"})
public class PayRollComponentFacadeIT {
@Autowired
IPayRollComponentFacade payRollComponentFacade;
@ReplaceWithMock
@Autowired
IPayRollPersistenceManager payRollPersistenceManager;
I included mock context as @ContextConfiguration(loader = SpringockitoContextLoader.class, locations = {"classpath*:/MockApplicationContext.xml"})
But I have to include the spring context as well @ContextConfiguration(locations = {"classpath*:/testApplicationContext.xml"})
Rajib Relations
source
share