From 4fd8a9976038b82211a6741eec2948b83fa06335 Mon Sep 17 00:00:00 2001 From: Stefano Cordio Date: Sun, 29 Oct 2023 08:08:27 +0100 Subject: [PATCH] Favor `@Value` to retrieve property value in README example (#17) --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ac765c0..59dd02b 100644 --- a/README.md +++ b/README.md @@ -35,13 +35,12 @@ class TodoControllerTests { @InjectWireMock("user-service") private WireMockServer wiremock; - - @Autowired - private Environment env; + + @Value("${user-client.url}") + private String wiremockUrl; // injects the base URL of the WireMockServer instance @Test void aTest() { - env.getProperty("user-client.url"); // returns a URL to WireMockServer instance wiremock.stubFor(...); } }