2017-03-13 72 views
0

我試圖重寫應用程序性能,文件是在這裏:test/resources/test.properties不能在JUnit測試overrid彈簧啓動應用程序性能

@TestPropertySource(locations="classpath:test.properties") 
@RunWith(SpringJUnit4ClassRunner.class) 
@SpringBootTest 
@WebAppConfiguration 
public abstract class ApplicationAbstractTest { 

但是當我運行任何測試 - 他們會尋找一個應用性(並沒有看到虛擬機選項app.conf):

@PropertySource(value = "file:${app.conf}") 
@SpringBootApplication 
public class Application { 

如何正確配置? '@TestPropertySource( 「/ test.properties」)':

+0

它爲我的作品後得到解決。 位於src/test/resources中的文件'test.properties' –

回答

0

它添加到ignoreResourceNotFound = true@PropertySource(value = "file:${app.conf}")