Failed to load ApplicationContext from Unit Test: FileNotFound

前端 未结 9 1046
夕颜
夕颜 2021-02-01 14:44

I am creating a Maven Spring project, which includes MVC, Data and Security. My Spring applicationContext-*.xml files are located at \\src\\main\\resources\\spring\\

My

9条回答
  •  生来不讨喜
    2021-02-01 15:18

    Give the below

    @ContextConfiguration(locations =  {"classpath*:/spring/test-context.xml"})
    

    And in pom.xml give the following plugin:

    
       org.apache.maven.plugins
       maven-surefire-plugin
       2.20.1
    
        
           ${basedir}/src/test/resources
        
    
    

提交回复
热议问题