Skip to content

Commit fb5469c

Browse files
committed
docs: moves examples to separate repository.
Moved to https://github.com/imposter-project/examples
1 parent 4671653 commit fb5469c

File tree

191 files changed

+53
-5226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+53
-5226
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,6 @@ updates:
2727
prefix: "chore"
2828
include: "scope"
2929

30-
- package-ecosystem: maven
31-
directory: "/examples/junit-sample"
32-
schedule:
33-
interval: "daily"
34-
target-branch: "develop"
35-
open-pull-requests-limit: 4
36-
labels:
37-
- "dependencies"
38-
- "examples"
39-
commit-message:
40-
prefix: "chore"
41-
include: "scope"
42-
4330
- package-ecosystem: docker
4431
directory: "/"
4532
schedule:

.github/workflows/examples.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ jobs:
88
contents: write
99
steps:
1010
- uses: actions/checkout@v4
11+
12+
- name: Remove placeholder examples directory
13+
run: rm -rf examples
14+
15+
- name: Checkout examples
16+
uses: actions/checkout@v4
17+
with:
18+
repository: 'imposter-project/examples'
19+
path: 'examples'
1120

1221
- name: Setup Java
1322
uses: actions/setup-java@v4

docs/benchmarks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ Configuration and commands to allow benchmarks to be independently reproduced.
5353

5454
#### Scenarios
5555

56-
- Scenario 1: Static, configuration-driven: [examples/rest/simple](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/rest/simple)
57-
- Scenario 2: Conditional, configuration-driven: [examples/rest/conditional-config](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/rest/conditional-config)
58-
- Scenario 3: Dynamic, script-driven: [examples/rest/conditional-scripted](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/rest/conditional-scripted)
56+
- Scenario 1: Static, configuration-driven: [examples/rest/simple](https://github.com/imposter-project/examples/blob/main/rest/simple)
57+
- Scenario 2: Conditional, configuration-driven: [examples/rest/conditional-config](https://github.com/imposter-project/examples/blob/main/rest/conditional-config)
58+
- Scenario 3: Dynamic, script-driven: [examples/rest/conditional-scripted](https://github.com/imposter-project/examples/blob/main/rest/conditional-scripted)
5959

6060
#### Start command
6161

docs/bundle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,5 @@ $ docker run --rm -it -p 8080:8080 example/mocks
144144

145145
This is a standard Docker container image, so you can push it to a registry and run it anywhere Docker runs.
146146

147-
> See [the Docker example project](https://github.com/imposter-project/imposter-jvm-engine/tree/main/examples/docker) for a working example.
147+
> See [the Docker example project](https://github.com/imposter-project/examples/tree/main/docker) for a working example.
148148

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ resources:
150150

151151
In this example, responses to both `/example1` and `/example2` will have the header `X-Always-Present: Yes` set, as it is inherited from the root configuration.
152152

153-
> See [default-response-config](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/rest/default-response-config) for an example.
153+
> See [default-response-config](https://github.com/imposter-project/examples/blob/main/rest/default-response-config) for an example.
154154

155155
#### Default response values
156156

docs/cors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ cors:
7272

7373
## Examples
7474

75-
- [cors-automatic](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/rest/cors-automatic/)
75+
- [cors-automatic](https://github.com/imposter-project/examples/blob/main/rest/cors-automatic/)

docs/data_capture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,4 +425,4 @@ Using JsonPath to capture the request body is computationally expensive, as it r
425425

426426
## Examples
427427

428-
- [data-capture](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/rest/data-capture)
428+
- [data-capture](https://github.com/imposter-project/examples/blob/main/rest/data-capture)

docs/embed_jvm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Imposter starts before your test runs, such as in your test set-up method (e.g.
88

99
## Getting started
1010

11-
> For a full working example project, see [examples/junit-sample](https://github.com/imposter-project/imposter-jvm-engine/tree/main/examples/junit-sample)
11+
> For a full working example project, see [examples/junit-sample](https://github.com/imposter-project/examples/tree/main/junit-sample)
1212
1313
First, note the latest [release version](https://github.com/imposter-project/imposter-jvm-engine/releases).
1414

@@ -49,7 +49,7 @@ String mockEndpoint = imposter.getBaseUrl() + "/v1/pets";
4949
// simulated HTTP responses, in place of a real endpoint.
5050
```
5151

52-
> For a full working example project, see [examples/junit-sample](https://github.com/imposter-project/imposter-jvm-engine/tree/main/examples/junit-sample)
52+
> For a full working example project, see [examples/junit-sample](https://github.com/imposter-project/examples/tree/main/junit-sample)
5353
5454
## Using a full configuration file
5555

docs/examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
See [examples](../../examples).
1+
See [examples](https://github.com/imposter-project/examples).

docs/fake_data.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Some common examples:
5656
5757
#### Try it out
5858

59-
See the [example directory](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/rest/fake-data) for a working example.
59+
See the [example directory](https://github.com/imposter-project/examples/blob/main/rest/fake-data) for a working example.
6060

6161
```bash
6262
curl http://localhost:8080/users/1
@@ -80,7 +80,7 @@ When using the `fake-data` plugin with the OpenAPI plugin, common property names
8080

8181
#### Try it out
8282

83-
See the [example directory](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/openapi/fake-data) for a working example.
83+
See the [example directory](https://github.com/imposter-project/examples/blob/main/openapi/fake-data) for a working example.
8484

8585
For example:
8686

docs/groovy_tips.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ For more sophisticated script development, you can set up a project in your IDE
123123

124124
This requires setting up a project with a dependency on `imposter-api.jar` and adding the GroovyDSL (GDSL) file.
125125

126-
➡️ [See an example project](https://github.com/imposter-project/imposter-jvm-engine/tree/main/examples/groovy-dsl)
126+
➡️ [See an example project](https://github.com/imposter-project/examples/tree/main/groovy-dsl)
127127

128128
If you just want to download the GDSL file see:
129129

130-
➡️ [Download the GDSL file](https://github.com/imposter-project/imposter-jvm-engine/tree/main/examples/groovy-dsl/src/main/resources/imposter.gdsl)
130+
➡️ [Download the GDSL file](https://github.com/imposter-project/examples/tree/main/groovy-dsl/src/main/resources/imposter.gdsl)

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ To begin, check out the [Getting started](getting_started.md) guide. See the _Co
4141
- [JavaScript scripting tips](javascript_tips.md)
4242
- [Groovy scripting tips](groovy_tips.md)
4343
- [JavaScript compatibility](scripting_modern_js.md)
44-
- [Examples](https://github.com/imposter-project/imposter-jvm-engine/tree/main/examples)
44+
- [Examples](https://github.com/imposter-project/examples/tree/main)
4545

4646
### Data capture and storage
4747

docs/interceptors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,5 @@ Both interceptors store data, which is later used by the `/example` resource.
120120

121121
See the following examples:
122122

123-
- See [examples/rest/interceptors-simple](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/rest/interceptors-simple) for a short-circuit example.
124-
- See [examples/rest/interceptors-passthrough](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/rest/interceptors-passthrough) for a passthrough example.
123+
- See [examples/rest/interceptors-simple](https://github.com/imposter-project/examples/blob/main/rest/interceptors-simple) for a short-circuit example.
124+
- See [examples/rest/interceptors-passthrough](https://github.com/imposter-project/examples/blob/main/rest/interceptors-passthrough) for a passthrough example.

docs/metrics_logs_telemetry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Other useful metrics:
5858
| script_execution_duration | Script engine execution duration in seconds |
5959
| script_cache_entries | The number of cached compiled scripts |
6060

61-
> Also see [the metrics example](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/metrics).
61+
> Also see [the metrics example](https://github.com/imposter-project/examples/blob/main/metrics).
6262
6363
## Logs
6464

docs/openapi_plugin.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Once you're finished, stop the server with CTRL+C.
152152

153153
> For more working examples, see:
154154
>
155-
> * [examples/openapi](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/openapi)
155+
> * [examples/openapi](https://github.com/imposter-project/examples/blob/main/openapi)
156156

157157
## Validating requests against the specification
158158

@@ -327,7 +327,7 @@ HTTP/1.1 400 Bad Request
327327

328328
## Object response examples
329329

330-
Imposter has basic support for response examples defined as objects, for example an API specification like `object-examples.yaml` - see [examples/openapi/object-examples](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/openapi/object-examples).
330+
Imposter has basic support for response examples defined as objects, for example an API specification like `object-examples.yaml` - see [examples/openapi/object-examples](https://github.com/imposter-project/examples/blob/main/openapi/object-examples).
331331

332332
The salient part of the response is as follows:
333333

@@ -402,7 +402,7 @@ For more advanced scenarios, you can also control Imposter's responses using Jav
402402
403403
> See the [Scripting](scripting.md) section for more information.
404404
405-
For a simple script, see [examples/openapi/scripted-named-example](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/openapi/scripted-named-example) for a working example.
405+
For a simple script, see [examples/openapi/scripted-named-example](https://github.com/imposter-project/examples/blob/main/openapi/scripted-named-example) for a working example.
406406
407407
### Additional context objects
408408
@@ -484,9 +484,9 @@ paths:
484484

485485
#### Examples
486486

487-
- [scripted-named-example](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/openapi/scripted-named-example)
488-
- [scripted-named-example-js](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/openapi/scripted-named-example-js)
489-
- [static-named-example](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/openapi/static-named-example)
487+
- [scripted-named-example](https://github.com/imposter-project/examples/blob/main/openapi/scripted-named-example)
488+
- [scripted-named-example-js](https://github.com/imposter-project/examples/blob/main/openapi/scripted-named-example-js)
489+
- [static-named-example](https://github.com/imposter-project/examples/blob/main/openapi/static-named-example)
490490

491491
### Configuration reference
492492

docs/openapi_validation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ This is because in the corresponding part of the OpenAPI specification, both the
7171
7272
Note that if the request body were provided, its structure would be validated against the corresponding schema entry.
7373
74-
See [examples/openapi/request-validation](https://github.com/imposter-project/imposter-jvm-engine/blob/master/examples/openapi/request-validation) for a working example.
74+
See [examples/openapi/request-validation](https://github.com/imposter-project/examples/blob/main/openapi/request-validation) for a working example.
7575
7676
## Configuring issue behaviour
7777

docs/run_imposter_docker.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ To run Imposter, map the path to the configuration files directory to the `/opt/
6565

6666
docker run -ti -v /path/to/config:/opt/imposter/config -p 8080:8080 outofcoffee/imposter
6767

68-
> To get up and running quickly, see the [examples](https://github.com/imposter-project/imposter-jvm-engine/tree/main/examples).
68+
> To get up and running quickly, see the [examples](https://github.com/imposter-project/examples/tree/main).
6969
7070
### Example
7171

@@ -142,7 +142,7 @@ However, it is possible to build container images and use shell commands in a Do
142142

143143
> **An example**
144144
>
145-
> Here is an example of a custom Docker image: https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/docker/Dockerfile
145+
> Here is an example of a custom Docker image: https://github.com/imposter-project/examples/blob/main/docker/Dockerfile
146146
>
147147
> This example extends from the Java base image so has its various userspace tools available (and more you can install with the package manager).
148148

docs/scripting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ For example:
3434
201 Created
3535

3636
> **Note**
37-
> See this [rest plugin example](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/rest/conditional-scripted) for a simple example.
37+
> See this [rest plugin example](https://github.com/imposter-project/examples/blob/main/rest/conditional-scripted) for a simple example.
3838

3939
### Another example
4040

@@ -258,7 +258,7 @@ respond().withExampleName('example1')
258258
This selects the example from the OpenAPI `examples` section for the API response.
259259

260260
> **Note**
261-
> See this [openapi plugin example](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/openapi/scripted-named-example) for a simple example.
261+
> See this [openapi plugin example](https://github.com/imposter-project/examples/blob/main/openapi/scripted-named-example) for a simple example.
262262

263263
### Using stores
264264

docs/scripting_legacy_js.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ curl -i http://localhost:8080/pets
6363
]
6464
```
6565

66-
* See the `examples/rest/conditional-scripted` directory [in GitHub](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/rest/conditional-scripted).
66+
* See the `examples/rest/conditional-scripted` directory [in GitHub](https://github.com/imposter-project/examples/blob/main/rest/conditional-scripted).

docs/scripting_modern_js.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To use the GraalVM JavaScript engine, you need to be running Imposter v4.0.0 or
1818

1919
## Examples
2020

21-
For examples, see the `examples/graal` directory [in GitHub](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/graal).
21+
For examples, see the `examples/graal` directory [in GitHub](https://github.com/imposter-project/examples/blob/main/graal).
2222

2323
### Simple example
2424

@@ -38,7 +38,7 @@ Hello Ada
3838

3939
### Advanced example
4040

41-
See the `examples/graal/es6` [directory](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/graal) for an example of using modern JavaScript features in a script.
41+
See the `examples/graal/es6` [directory](https://github.com/imposter-project/examples/blob/main/graal) for an example of using modern JavaScript features in a script.
4242

4343
---
4444

docs/security.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,5 +246,5 @@ resources:
246246

247247
See the `examples` directory for working sample configurations, such as:
248248

249-
* [Simple authentication](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/openapi/authentication-simple)
250-
* [Extended authentication](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/openapi/authentication-extended)
249+
* [Simple authentication](https://github.com/imposter-project/examples/blob/main/openapi/authentication-simple)
250+
* [Extended authentication](https://github.com/imposter-project/examples/blob/main/openapi/authentication-extended)

docs/soap_plugin.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ Once you're finished, stop the server with CTRL+C.
156156

157157
> For more working examples, see:
158158
>
159-
> * [examples/soap](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/soap)
159+
> * [examples/soap](https://github.com/imposter-project/examples/blob/main/soap)
160160

161161
## Conditional responses
162162

@@ -248,15 +248,15 @@ resources:
248248

249249
> **Tip**
250250
> Use conditional matching with resources, to only return a fault in particular circumstances.
251-
> See [fault-example](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/soap/fault-example) for an example of how to do this.
251+
> See [fault-example](https://github.com/imposter-project/examples/blob/main/soap/fault-example) for an example of how to do this.
252252

253253
## Scripted responses (advanced)
254254

255255
For more advanced scenarios, you can also control Imposter's responses using JavaScript or Groovy scripts.
256256

257257
> See the [Scripting](scripting.md) section for more information.
258258

259-
For a simple script, see [examples/soap/scripted-example](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/soap/scripted-example) for a working example.
259+
For a simple script, see [examples/soap/scripted-example](https://github.com/imposter-project/examples/blob/main/soap/scripted-example) for a working example.
260260

261261
### Additional context objects
262262

@@ -317,9 +317,9 @@ respond().withStatusCode(500)
317317

318318
#### Scripting examples
319319

320-
- [conditional-example](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/soap/conditional-example)
321-
- [scripted-example](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/soap/scripted-example)
322-
- [fault-example](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/soap/fault-example)
320+
- [conditional-example](https://github.com/imposter-project/examples/blob/main/soap/conditional-example)
321+
- [scripted-example](https://github.com/imposter-project/examples/blob/main/soap/scripted-example)
322+
- [fault-example](https://github.com/imposter-project/examples/blob/main/soap/fault-example)
323323

324324
### Configuration reference
325325

docs/template_queries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ Using JsonPath in placeholder templates is computationally expensive, as it requ
6868

6969
## Examples
7070

71-
- [response-template](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/rest/response-template)
71+
- [response-template](https://github.com/imposter-project/examples/blob/main/rest/response-template)

docs/templates.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,4 +360,4 @@ Template files are cached in memory once read from disk, so they do not incur as
360360

361361
## Examples
362362

363-
- [response-template](https://github.com/imposter-project/imposter-jvm-engine/blob/main/examples/rest/response-template)
363+
- [response-template](https://github.com/imposter-project/examples/blob/main/rest/response-template)

examples/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
# Imposter examples
2-
3-
Sample configuration files for various scenarios.
4-
5-
> See [the documentation](https://docs.imposter.sh) for more detail.
1+
See [examples](https://github.com/imposter-project/examples).

examples/docker-healthcheck/Dockerfile

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/docker-healthcheck/config/imposter-config.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

examples/docker-healthcheck/docker-compose.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/docker-shell/Dockerfile

Lines changed: 0 additions & 12 deletions
This file was deleted.

examples/docker-shell/config/imposter-config.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)