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 c0ca992 commit 5a46b9d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@
import org.springframework.hateoas.MediaTypes;
import org.springframework.hateoas.client.Traverson;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.web.server.LocalServerPort;

@ExtendWith(SpringExtension.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
public class GreetingTraversonIntegrationTests {

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

@Test
Expand Down

0 comments on commit 5a46b9d

Please sign in to comment.