Skip to content

Commit d083354

Browse files
docs: Add readme for spring-petclinic (#62)
* fix: updated the app to create tables everytime Signed-off-by: Pranshu Srivastava <[email protected]> * added readme for petclinic Signed-off-by: Pranshu Srivastava <[email protected]> * removed unnecesary files Signed-off-by: Pranshu Srivastava <[email protected]> --------- Signed-off-by: Pranshu Srivastava <[email protected]>
1 parent 26c2323 commit d083354

File tree

4 files changed

+1237
-989
lines changed

4 files changed

+1237
-989
lines changed

spring-petclinic/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
## Introduction
2+
3+
This is a petclinic website where you can record testcases and mocks by interacting with the UI, and then test them using Keploy.
4+
This project has two parts - the frontend and backend, since Keploy is a backend testing platform, we need to start the backend part of the project
5+
using Keploy and run the frontend as it is.
6+
7+
## Setup the frontend
8+
9+
```
10+
git clone https://github.com/keploy/samples-java.git
11+
cd samples-java/spring-petclinic/spring-petclinic-angular
12+
npm uninstall -g angular-cli @angular/cli
13+
npm cache clean
14+
npm install -g @angular/cli@latest
15+
npm install --save-dev @angular/cli@latest
16+
npm i
17+
```
18+
19+
## Start the frontend
20+
21+
```
22+
npm run start
23+
```
24+
25+
## Spin up the database
26+
27+
```
28+
docker run -e POSTGRES_USER=petclinic -e POSTGRES_PASSWORD=petclinic -e POSTGRES_DB=petclinic -p 5432:5432 --net keploy-network postgres:15.2
29+
```
30+
31+
## Setup Keploy
32+
33+
```
34+
wget https://raw.githubusercontent.com/keploy/keploy/main/keploy.sh && source keploy.sh
35+
```
36+
37+
## Setup the backend
38+
39+
```
40+
cd samples-java/spring-petclinic/spring-petclinic-rest
41+
mvn clean install -Dmaven.test.skip=true
42+
```
43+
44+
## Run the backend with Keploy
45+
46+
```
47+
keploy record -c "java -jar target/<name-of-your-jar>"
48+
```
49+
50+
Now when you interact with the UI, the tests should start getting created in a folder called 'keploy' in the directory where you started the backend. When you are done recording the testcases and mocks, you can test them using keploy.
51+
52+
## Testing the testcases using Keploy
53+
54+
```
55+
keploy test -c "java -jar target/<name-of-your-jar>"
56+
```
57+
58+
Hope this helps you out, if you still have any questions, reach out to us on our [Slack](https://join.slack.com/t/keploy/shared_invite/zt-12rfbvc01-o54cOG0X1G6eVJTuI_orSA)
59+
60+
61+

0 commit comments

Comments
 (0)