Skip to content

Commit

Permalink
Favor @Value to retrieve property value in README example (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
scordio authored Oct 29, 2023
1 parent c288bdb commit 4fd8a99
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(...);
}
}
Expand Down

0 comments on commit 4fd8a99

Please sign in to comment.