I'm preparing a test env. for my project.
I have a bunch of maven projects and some of the projects are using common configuration for spring beans test (test-context.xml). All the tests works when I have this configuration in src\test\resources
of every project. When I want to move that configuration to a separate project (project-test) to eliminate duplicates in every project I get an Exception:
Caused by: java.io.FileNotFoundException: class path resource [test-context.xml] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:157)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
... 39 more
- I've added a maven dependency to project-tests in the project with tests
- the test-context.xml doesn't go to the target directory
- when I put my resources in
src/main/resources
instead ofsrc/test/resources
it works
What is the way to add the test resource from another project so it's visible from a TestNG test?
Is moving it to src/main/resources
the best way in this situation?