Skip to content

Commit fe8cdd5

Browse files
author
Jay Bryant
committed
Back to using LocalServerPort.
1 parent 26ddfee commit fe8cdd5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

complete/src/test/java/com/example/testingweb/HttpRequestTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
88
import org.springframework.boot.test.web.client.TestRestTemplate;
99
import org.springframework.beans.factory.annotation.Value;
10+
import org.springframework.boot.test.web.server.LocalServerPort;
1011

1112
import static org.assertj.core.api.Assertions.assertThat;
1213

1314
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
1415
class HttpRequestTest {
1516

16-
@Value(value="${local.server.port}")
17+
@LocalServerPort
1718
private int port;
1819

1920
@Autowired

0 commit comments

Comments
 (0)