2

I have a project called X which has wireup.xml laid as follows :

X/
 Module/
       src/
           main/
               resources/
                        com.here/
                                wireup.xml  

I import Module of project X in project Y as

    <dependency>
        <groupId>com.org.X</groupId>
        <artifactId>Module</artifactId>
        <version>master-SNAPSHOT</version>
    </dependency>  

Now in the test I want bean that is in wireup.xml, so I do the following :

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:com/org/X/Module/src/main/resources/com/here/wireup.xml"})
public class MongoSaverTest extends Case {
  @Autowired
  private SomeBeanInWireup variable;
}   

But I get error on running the test saying

Caused by: java.io.FileNotFoundException: class path resource [com/org/X/Module/src/main/resources/com/here/wireup.xml] cannot be opened because it does not exist

How can I fix this? How can I know the correct path?

2 Answers 2

3

It should just be @ContextConfiguration(locations = {"classpath:com/here/wireup.xml"})

Sign up to request clarification or add additional context in comments.

Comments

0

The path for your resource is classpath:com/here/wireup.xml

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.