We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26ddfee commit fe8cdd5Copy full SHA for fe8cdd5
complete/src/test/java/com/example/testingweb/HttpRequestTest.java
@@ -7,13 +7,14 @@
7
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
8
import org.springframework.boot.test.web.client.TestRestTemplate;
9
import org.springframework.beans.factory.annotation.Value;
10
+import org.springframework.boot.test.web.server.LocalServerPort;
11
12
import static org.assertj.core.api.Assertions.assertThat;
13
14
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
15
class HttpRequestTest {
16
- @Value(value="${local.server.port}")
17
+ @LocalServerPort
18
private int port;
19
20
@Autowired
0 commit comments