I am running into a problem with IDEA and I would appreciate any help in resolving this. I have a test class(TestNG) that references a Spring (3.1) configuration file for DI. This works fine when running the test through mvn. It also works fine when running it in Eclipse. However when I try to run it through IDEA it seems that DI doesn't take place and my test fails. Interestingly enough the IDE seems to properly resolve the beans in my test class. Here is how the code looks:
@ContextConfiguration("classpath:my-config.xml")
public BaseTest
{
@Autowired
private SomeType myVar;
}
public Test1 extends BaseTest
{
public void someTest()
{
// uses myVar but fails because it's null
}
}
The xml files are not probably copied to your classpath. This may help.