Skip to content

Commit 47bd365

Browse files
committed
issues/2334 | sample spring elastic app
* added test cases Signed-off-by: Snoopy009 <[email protected]>
1 parent aa81e91 commit 47bd365

File tree

4 files changed

+154
-20
lines changed

4 files changed

+154
-20
lines changed

spring-elastic/.gitignore

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,15 @@
11
HELP.md
22
target/
3-
src/main/resources/application.properties
3+
keploy/test-set-0/mocks.yaml
44
!.mvn/wrapper/maven-wrapper.jar
55
!**/src/main/**/target/
66
!**/src/test/**/target/
77

8-
### STS ###
9-
.apt_generated
10-
.classpath
11-
.factorypath
12-
.project
13-
.settings
14-
.springBeans
15-
.sts4-cache
16-
178
### IntelliJ IDEA ###
189
.idea
1910
*.iws
2011
*.iml
2112
*.ipr
2213

23-
### NetBeans ###
24-
/nbproject/private/
25-
/nbbuild/
26-
/dist/
27-
/nbdist/
28-
/.nb-gradle/
29-
build/
30-
!**/src/main/**/build/
31-
!**/src/test/**/build/
32-
3314
### VS Code ###
3415
.vscode/

spring-elastic/keploy.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
path: ""
2+
appId: 0
3+
appName: spring-elastic
4+
command: mvn spring-boot:run
5+
templatize:
6+
testSets: []
7+
port: 0
8+
dnsPort: 26789
9+
proxyPort: 16789
10+
debug: false
11+
disableTele: false
12+
disableANSI: false
13+
containerName: ""
14+
networkName: ""
15+
buildDelay: 30
16+
test:
17+
selectedTests: {}
18+
globalNoise:
19+
global: {}
20+
test-sets: {}
21+
delay: 5
22+
host: ""
23+
port: 0
24+
apiTimeout: 5
25+
skipCoverage: false
26+
coverageReportPath: ""
27+
ignoreOrdering: true
28+
mongoPassword: default@123
29+
language: ""
30+
removeUnusedMocks: false
31+
fallBackOnMiss: false
32+
jacocoAgentPath: ""
33+
basePath: ""
34+
mocking: true
35+
ignoredTests: {}
36+
disableLineCoverage: false
37+
disableMockUpload: true
38+
useLocalMock: false
39+
updateTemplate: false
40+
record:
41+
filters: []
42+
recordTimer: 0s
43+
configPath: ""
44+
bypassRules: []
45+
generateGithubActions: false
46+
keployContainer: keploy-v2
47+
keployNetwork: keploy-network
48+
cmdType: native
49+
contract:
50+
services: []
51+
tests: []
52+
path: ""
53+
download: false
54+
generate: false
55+
driven: consumer
56+
mappings:
57+
servicesMapping: {}
58+
self: ""
59+
inCi: false
60+
61+
# Visit [https://keploy.io/docs/running-keploy/configuration-file/] to learn about using keploy through configration file.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
version: api.keploy.io/v1beta1
2+
kind: Http
3+
name: test-1
4+
spec:
5+
metadata: {}
6+
req:
7+
method: GET
8+
proto_major: 1
9+
proto_minor: 1
10+
url: http://localhost:8081/book/find_by_name?name=Great
11+
url_params:
12+
name: Great
13+
header:
14+
Accept: '*/*'
15+
Accept-Encoding: gzip, deflate, br
16+
Connection: keep-alive
17+
Host: localhost:8081
18+
User-Agent: PostmanRuntime/7.26.8
19+
body: ""
20+
timestamp: 2024-10-14T21:38:34.683468007+02:00
21+
resp:
22+
status_code: 200
23+
header:
24+
Connection: keep-alive
25+
Content-Type: application/json
26+
Date: Mon, 14 Oct 2024 19:38:25 GMT
27+
Keep-Alive: timeout=60
28+
body: '[{"id":"1","name":"The Great Gatsby","description":"A novel set in the Jazz Age that tells the story of Jay Gatsby and his love for Daisy Buchanan.","price":30.0}]'
29+
status_message: OK
30+
proto_major: 0
31+
proto_minor: 0
32+
timestamp: 2024-10-14T21:38:27.656159256+02:00
33+
objects: []
34+
assertions:
35+
noise:
36+
header.Date: []
37+
created: 1728934707
38+
curl: |
39+
curl --request GET \
40+
--url http://localhost:8081/book/find_by_name?name=Great \
41+
--header 'Accept-Encoding: gzip, deflate, br' \
42+
--header 'Connection: keep-alive' \
43+
--header 'User-Agent: PostmanRuntime/7.26.8' \
44+
--header 'Accept: */*' \
45+
--header 'Host: localhost:8081' \
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
version: api.keploy.io/v1beta1
2+
kind: Http
3+
name: test-2
4+
spec:
5+
metadata: {}
6+
req:
7+
method: POST
8+
proto_major: 1
9+
proto_minor: 1
10+
url: http://localhost:8081/book/create
11+
header:
12+
Accept: '*/*'
13+
Accept-Encoding: gzip, deflate, br
14+
Connection: keep-alive
15+
Content-Length: "242"
16+
Content-Type: application/json
17+
Host: localhost:8081
18+
User-Agent: PostmanRuntime/7.26.8
19+
body: "{\r\n \"id\": \"2\",\r\n \"name\": \"Harry Potter\",\r\n \"description\": \"A magical journey of a young wizard, Harry Potter, as he navigates his adventures in the wizarding world and faces his ultimate enemy, Lord Voldemort.\",\r\n \"price\": 50\r\n}\r\n"
20+
timestamp: 2024-10-14T21:41:09.856797417+02:00
21+
resp:
22+
status_code: 200
23+
header:
24+
Connection: keep-alive
25+
Content-Type: application/json
26+
Date: Mon, 14 Oct 2024 19:40:45 GMT
27+
Keep-Alive: timeout=60
28+
body: '{"id":"2","name":"Harry Potter","description":"A magical journey of a young wizard, Harry Potter, as he navigates his adventures in the wizarding world and faces his ultimate enemy, Lord Voldemort.","price":50.0}'
29+
status_message: OK
30+
proto_major: 0
31+
proto_minor: 0
32+
timestamp: 2024-10-14T21:40:47.610951139+02:00
33+
objects: []
34+
assertions:
35+
noise:
36+
header.Date: []
37+
created: 1728934847
38+
curl: |-
39+
curl --request POST \
40+
--url http://localhost:8081/book/create \
41+
--header 'Accept-Encoding: gzip, deflate, br' \
42+
--header 'User-Agent: PostmanRuntime/7.26.8' \
43+
--header 'Host: localhost:8081' \
44+
--header 'Connection: keep-alive' \
45+
--header 'Content-Type: application/json' \
46+
--header 'Accept: */*' \
47+
--data "{\r\n \"id\": \"2\",\r\n \"name\": \"Harry Potter\",\r\n \"description\": \"A magical journey of a young wizard, Harry Potter, as he navigates his adventures in the wizarding world and faces his ultimate enemy, Lord Voldemort.\",\r\n \"price\": 50\r\n}\r\n"

0 commit comments

Comments
 (0)