簡體   English   中英

如何在一次測試中啟動2個春季啟動應用程序?

[英]How to boot up 2 spring boot application in one test?

我有兩個應該在不同端口上運行的Spring啟動應用程序(REST服務)。

我想在一次集成測試中將它們組合在一起。 對於一個應用程序,它看起來像:

@SpringApplicationConfiguration(classes = FirstApplication.class)
@WebIntegrationTest({"server.port=8080", "management.port=0"})

他們是完全不同的。 他們怎么能用一種方法開始?

您是否嘗試在application.properties文件或yaml中設置它? 就像是

server.port = $ {端口:8080}

我想你會在這里找到更多信息:

https://docs.spring.io/spring-boot/docs/current/reference/html/howto-properties-and-configuration.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM