Skip to content

Commit c1ce66a

Browse files
authored
Fixed the image issue in employee app docs (#513)
Signed-off-by: Achanandhi-M <[email protected]>
1 parent b44c1de commit c1ce66a

7 files changed

+18
-16
lines changed
Loading
Loading
Loading
Loading
177 KB
Loading
97.5 KB
Loading

โ€Žversioned_docs/version-2.0.0/quickstart/samples-java.md

+18-16
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import InstallationGuide from '../concepts/installation.md'
3737

3838
## Setup Employee-Manager App
3939

40-
### Application Pre-Requisites ๐Ÿ“‹
40+
### Application Pre-Requisites
4141

4242
- Java 1.8+ or {'<'}17 โ˜•
4343
- Maven ๐Ÿ› ๏ธ
@@ -54,12 +54,12 @@ You can start the backend using Keploy in 2 ways:
5454
- [Using Keploy's binary](#instructions-for-starting-using-binary)
5555
- [Using Keploy's docker image](#instructions-for-starting-using-docker)
5656

57-
# Instructions For Starting Using Binary
57+
## Instructions For Starting Using Binary
5858

59-
## Setup the backend
59+
### Setup the backend
6060

6161
You need to update the postgresql properties, go to
62-
`spring-petclinic/spring-petclinic-rest/src/main/resources/application-postgresql.properties`
62+
`employee-manager/src/main/resources/application-postgresql.properties`
6363
and change
6464

6565
```bash
@@ -78,7 +78,7 @@ and then build the jar using:
7878
mvn clean install -Dmaven.test.skip=true
7979
```
8080

81-
## Start the Postgres DB ๐Ÿณ
81+
### Start the Postgres DB ๐Ÿณ
8282

8383
```bash
8484
docker run -e POSTGRES_USER=keploy-user -e POSTGRES_PASSWORD=keploy -e POSTGRES_DB=postgres -p 5432:5432 --name postgres postgres:15.2
@@ -92,7 +92,7 @@ Note: You may have to use sudo if you are not part of the docker group.
9292
keploy record -c "java -jar target/springbootapp-0.0.1-SNAPSHOT.jar"
9393
```
9494

95-
![Testcases](https://github.com/keploy/samples-java/blob/main/employee-manager/img/keploy-record-docker.png)
95+
![Testcases](/img/keploy-record-docker-employee-app.png)
9696

9797
Now let's run a few tests to capture some more scenarios:
9898

@@ -140,7 +140,7 @@ directory would also have `mock.yml` file.
140140

141141
Now, let's see the magic! ๐Ÿช„๐Ÿ’ซ
142142

143-
## Run the test cases
143+
### Run the test cases
144144

145145
First lets shutdown the database to verify that keploy's magic is taking care of the database mocking. No need to worry
146146
about the database anymore! ๐ŸŽ‰
@@ -155,7 +155,7 @@ Now, let's run the keploy in test mode: -
155155
keploy test -c "java -jar target/springbootapp-0.0.1-SNAPSHOT.jar" --delay 10
156156
```
157157

158-
This will run the testcases and generate the report in `keploy/testReports` folder. You will see the following output:-
158+
This will run the testcases and generate the report in `keploy/reports` folder. You will see the following output:-
159159

160160
````shell
161161
๐Ÿฐ Keploy: 2025-04-17T13:30:11+05:30 INFO starting test for of {"test case": "[test-1]", "test set": "[test-set-0]"}
@@ -206,27 +206,29 @@ Worry not, just add the ever-changing fields (like our **ts** here) to the **noi
206206
207207
> Pro tip: Add `body.timestamp` to noise in `keploy.yml`.
208208
209-
<img src="https://github.com/keploy/samples-java/blob/main/employee-manager/img/test-noise.png" alt="Adding Noise to Test case Java Postgres Employee Manager App" width="70%" style={{ borderRadius: '5px' }}/>
209+
<img src="/docs/img/test-noise-employee-app.png" alt="Adding Noise to Test case Java Postgres Employee Manager App" width="70%" style={{ borderRadius: '5px' }}/>
210210
211211
Run that `keploy test` command once more and watch as everything falls into place with all tests passing! ๐ŸŒŸ
212212
213213
Final thoughts? Dive deeper! Try different API calls, tweak the DB response in the `mocks.yml`, or fiddle with the request or response in `test-x.yml`. Run the tests again and see the magic unfold! โœจ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ปโœจ
214214
215215
Next we move on to the instructions to start the application using docker.
216216
217-
# Instructions For Starting Using Docker
217+
## Instructions For Starting Using Docker
218218
219219
Prerequisites For Docker:
220220
221-
1. Docker Desktop 4.25.2 and above
221+
1. Docker Desktop 4.25.2 and above or docker cli installed
222222
223223
Here we just need to change the command used to start the application.
224224
225+
### Capture the testcases ๐ŸŽฌ
226+
225227
```bash
226228
keploy record -c "docker compose up" --container-name javaApp --build-delay 100
227229
```
228230
229-
<img src="https://github.com/keploy/samples-java/blob/main/employee-manager/img/Keploy-record-docker-compose.png" alt="Sample Keploy Record Java" width="100%" style={{ borderRadius: '5px' }} />
231+
<img src="/docs/img/Keploy-record-docker-compose-employee-app.png" alt="Sample Keploy Record Java" width="100%" style={{ borderRadius: '5px' }} />
230232
231233
Now let's run a few tests to capture some more scenarios:
232234
@@ -274,17 +276,17 @@ directory would also have `mock.yml` file.
274276
275277
Now, let's see the magic! ๐Ÿช„๐Ÿ’ซ
276278
277-
## Running the testcases using Keploy
279+
### Running the testcases using Keploy
278280
279281
```bash
280282
keploy test -c "docker compose up" --container-name javaApp --build-delay 50 --delay 20
281283
```
282284
283285
Your CLI should look something like this
284-
<img src="/static/img/keploy-test-docker-compose-command.png" alt="Sample Keploy Test Java" width="100%" style={{ borderRadius: '5px' }} />
286+
<img src="/docs/img/keploy-test-docker-compose-command.png" alt="Sample Keploy Test Java" width="100%" style={{ borderRadius: '5px' }} />
285287
286288
This is a summary of the test cases recorded
287-
<img src="https://github.com/keploy/samples-java/blob/main/employee-manager/img/Keploy-test-docker-compose.png" alt="Sample Keploy Test Summary Java" width="100%" style={{ borderRadius: '5px' }} />
289+
<img src="/docs/img/Keploy-test-docker-compose-employee-app.png" alt="Sample Keploy Test Summary Java" width="100%" style={{ borderRadius: '5px' }} />
288290
289291
Here `delay` is the time it takes for your application to get started, after which Keploy will start running the testcases. If your application takes longer than 10s to get started, you can change the `delay` accordingly.
290292
`buildDelay` is the time that it takes for the image to get built. This is useful when you are building the docker image from your docker compose file itself.
@@ -293,7 +295,7 @@ Here `delay` is the time it takes for your application to get started, after whi
293295
294296
Congrats on the journey so far! You've seen Keploy's power, flexed your coding muscles, and had a bit of fun too! Now, go out there and keep exploring, innovating, and creating! Remember, with the right tools and a sprinkle of fun, anything's possible. ๐Ÿ˜Š๐Ÿš€
295297
296-
### ๐Ÿš€ Wanna try Keploy in CI/CD?
298+
## ๐Ÿš€ Wanna try Keploy in CI/CD?
297299
298300
We got you ๐Ÿ˜Ž
299301
Hereโ€™s how to set it up with GitHub Actions:

0 commit comments

Comments
ย (0)