Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejwalkowiak committed Mar 31, 2023
1 parent 7a09f05 commit b10ab31
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Add the dependency to `wiremock-spring-boot`:
<dependency>
<groupId>com.maciejwalkowiak.spring</groupId>
<artifactId>wiremock-spring-boot</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<scope>test</scope>
</dependency>
```
Expand All @@ -33,7 +33,7 @@ Use `@EnableWireMock` with `@ConfigureWireMock` with tests annotated that use `S
})
class TodoControllerTests {

@WireMock("user-service")
@InjectWireMock("user-service")
private WireMockServer wiremock;

@Autowired
Expand All @@ -49,7 +49,7 @@ class TodoControllerTests {

- `@EnableWireMock` adds test context customizer and enables `WireMockSpringExtension`
- `@ConfigureWireMock` creates a `WireMockServer` and passes the `WireMockServer#baseUrl` to a Spring environment property with a name given by `property`.
- `@WireMock` injects `WireMockServer` instance to a test
- `@InjectWireMock` injects `WireMockServer` instance to a test

Note that `WireMockServer` instances are not added as beans to Spring application context to avoid polluting it with test-related infrastructure. Instead, instances are kept in a separate store associated with an application context.

Expand Down

0 comments on commit b10ab31

Please sign in to comment.