0

複数の Maven サブプロジェクトを含むプロジェクトがあります。Spring、JPA、JUnit を使用。

+common
   + WebserviceBindingProvider.java  
+views
   +......
   +src/main/test/TestClass.java
   +src/main/test/resources/mocking.properties

The "common" project has a class that reads the properties file "mocking.properties" that is in the "views" project test folders - src/main/test/resources/
The common.jar is added as dependency to the views project.

The code is something like below.

Resource resource = new ClassPathResource("/mock_endpoints.properties"); 
props = PropertiesLoaderUtils.loadProperties(resource);

テストケースを実行すると、「小道具」がnullになります。

誰かが私に欠けているものを教えてもらえますか?

4

1 に答える 1

1

あなたTestClass.javaは にいるべきでsrc/test/java/、あなたmocking.propertiesは にいるべきsrc/test/resources/です。

于 2012-10-25T14:03:33.177 に答える