Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update junit-jupiter.md #197

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions _docs/junit-jupiter.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,15 @@ The JUnit Jupiter extension can be configured to enable "proxy mode" which simpl
### Declarative

In declarative mode this is done by setting the `proxyMode = true` in the annotation declaration. Then, provided your app's
HTTP client honours the JVM's proxy system properties, you can specify different domain (host) names when creating stubs:
HTTP client honours the JVM's proxy system properties, you can specify different domain (host) names when creating stubs.

### Programmatic

Proxy mode can be enabled via the extension builder when using the programmatic form.

{% codetabs %}

{% codetab Declarative %}

```java
@WireMockTest(proxyMode = true)
Expand Down Expand Up @@ -205,9 +213,9 @@ public class JUnitJupiterExtensionJvmProxyDeclarativeTest {
}
```

### Programmatic
{% endcodetab %}

Proxy mode can be enabled via the extension builder when using the programmatic form:
{% codetab Programmatic %}

```java
public class JUnitJupiterProgrammaticProxyTest {
Expand Down Expand Up @@ -248,6 +256,10 @@ public class JUnitJupiterProgrammaticProxyTest {
}
```

{% endcodetab %}

{% endcodetabs %}

## Subclassing the extension

Like the JUnit 4.x rule, `WireMockExtension` can be subclassed in order to extend its behaviour by hooking into its lifecycle events.
Expand Down