Skip to content

Commit

Permalink
Use the @LocalServerPort annotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Bryant committed Oct 20, 2023
1 parent c5fc10a commit 454e93c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
import org.springframework.web.socket.client.WebSocketClient;
import org.springframework.web.socket.client.standard.StandardWebSocketClient;
import org.springframework.web.socket.messaging.WebSocketStompClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.web.server.LocalServerPort;


@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class GreetingIntegrationTests {

@Value(value="${local.server.port}")
@LocalServerPort
private int port;

private WebSocketStompClient stompClient;
Expand Down

0 comments on commit 454e93c

Please sign in to comment.