Junit + getResourceAsStream Returning Null

后端 未结 13 1374
情话喂你
情话喂你 2020-12-15 03:32

Not sure how this is possible. I re-read up on getResourceAsStream and it\'s always returning null.

InputStream source = this.getClass().getResourceAsStream(         


        
13条回答
  •  情歌与酒
    2020-12-15 03:37

    In case you are using Maven, add this part to your pom.xml

    
        
            
                ${project.basedir}/src/test/resources
            
        
    
    

    Your test.xml and other resource files must be located in src/test/resources

提交回复
热议问题