Skip to content

Commit 1431e3c

Browse files
test: add Java dedup replay fixtures
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
1 parent 5afc639 commit 1431e3c

1,005 files changed

Lines changed: 39244 additions & 4 deletions

File tree

Some content is hidden

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

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ This repo contains the sample for [Keploy's](https://keploy.io) Java Application
2323
4. [Springboot Postgres GraphQL](https://github.com/keploy/samples-java/tree/main/spring-boot-postgres-graphql) - This is a Spring Boot application implementing a GraphQL service to handle requests related to books and authors.
2424
5. [Springboot PetClinic](https://github.com/keploy/samples-java/tree/main/spring-petclinic) - This is a Pet Clinic app where you can record testcases and mocks by interacting with the UI, and then test them using Keploy.
2525
6. [SAP Demo (Customer 360)](https://github.com/keploy/samples-java/tree/main/sap-demo-java) - A Spring Boot "Customer 360" API that fronts SAP S/4HANA Cloud (Business Partner + Sales Order OData) and a local PostgreSQL store. Includes docker-compose, a kind-based k8s deploy, and Tosca-style flow scripts suitable for recording end-to-end Keploy testcases against PostgreSQL + outbound SAP HTTPS.
26+
7. [Java Dynamic Deduplication](https://github.com/keploy/samples-java/tree/main/java-dedup) - A Spring Boot sample used by CI to validate Enterprise Java dynamic dedup in native, Docker, and restricted Docker replay runs. CI uses checked-in fixtures and does not record this sample in the pipeline.
2627

2728
## Community Support ❤️
2829

java-dedup/.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/target/
2-
/keploy/
3-
/keploy.yml
2+
/keploy/reports/
43
/dedupData.yaml
54
/duplicates.yaml
65
/*.log

java-dedup/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Java Dynamic Deduplication Sample
22

3-
This sample is a Spring Boot application used by Keploy CI to validate Java dynamic deduplication in native and Docker runs. It mirrors the Go dedup sample by exposing a broad set of endpoints and driving 1000 randomized 200-response requests during record.
3+
This sample is a Spring Boot application used by Keploy CI to validate Java dynamic deduplication in native and Docker runs. It mirrors the Go dedup sample by exposing a broad set of endpoints and committing 1000 replay fixtures across four testsets.
4+
5+
CI does not record this sample. The `keploy/` directory is checked in so the pipeline only builds the app and runs replay with `--dedup`.
46

57
Build the application after installing the Java SDK locally:
68

@@ -15,7 +17,7 @@ java -javaagent:target/jacocoagent.jar=address=127.0.0.1,port=36320,destfile=tar
1517
-jar target/java-dedup-0.0.1-SNAPSHOT.jar
1618
```
1719

18-
Record high-volume traffic against the running app:
20+
To regenerate the committed fixtures locally, record high-volume traffic against the running app:
1921

2022
```bash
2123
./run_random_1000.sh

java-dedup/keploy.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Generated by Keploy (3-dev)
2+
path: ""
3+
appId: 0
4+
appName: ""
5+
command: ""
6+
templatize:
7+
testSets: []
8+
port: 0
9+
proxyPort: 16789
10+
incomingProxyPort: 36789
11+
dnsPort: 26789
12+
debug: false
13+
disableANSI: false
14+
disableTele: false
15+
generateGithubActions: false
16+
containerName: ""
17+
networkName: ""
18+
buildDelay: 30
19+
test:
20+
selectedTests: {}
21+
ignoredTests: {}
22+
globalNoise:
23+
global: {"body": {"current_time":[]}}
24+
test-sets: {}
25+
replaceWith:
26+
global: {}
27+
test-sets: {}
28+
delay: 5
29+
host: "localhost"
30+
port: 0
31+
grpcPort: 0
32+
ssePort: 0
33+
protocol:
34+
http:
35+
port: 0
36+
sse:
37+
port: 0
38+
grpc:
39+
port: 0
40+
apiTimeout: 5
41+
skipCoverage: false
42+
coverageReportPath: ""
43+
ignoreOrdering: true
44+
mongoPassword: "default@123"
45+
language: ""
46+
removeUnusedMocks: false
47+
fallBackOnMiss: false
48+
jacocoAgentPath: ""
49+
basePath: ""
50+
mocking: true
51+
disableLineCoverage: false
52+
disableMockUpload: false
53+
useLocalMock: false
54+
updateTemplate: false
55+
mustPass: false
56+
maxFailAttempts: 5
57+
maxFlakyChecks: 1
58+
protoFile: ""
59+
protoDir: ""
60+
protoInclude: []
61+
compareAll: false
62+
updateTestMapping: false
63+
disableAutoHeaderNoise: false
64+
# strictMockWindow enforces cross-test bleed prevention. Per-test
65+
# (LifetimePerTest) mocks whose request timestamp falls outside the
66+
# outer test window are dropped rather than promoted across tests.
67+
#
68+
# Default TRUE now that every stateful-protocol recorder classifies
69+
# mocks finely enough (per-connection data mocks, session vs per-test
70+
# distinction for connection-alive commands) that legitimate cross-
71+
# test sharing is encoded as session/connection lifetime rather than
72+
# implicit out-of-window reuse. If an older recording relies on the
73+
# legacy lax behaviour, opt out with strictMockWindow: false here or
74+
# export KEPLOY_STRICT_MOCK_WINDOW=0 — the env var wins.
75+
strictMockWindow: true
76+
dedup: false
77+
freezeTime: false
78+
fuzzyMatch: false
79+
record:
80+
recordTimer: 0s
81+
filters: []
82+
sync: false
83+
memoryLimit: 0
84+
configPath: ""
85+
bypassRules: []
86+
disableMapping: true
87+
contract:
88+
driven: "consumer"
89+
mappings:
90+
servicesMapping: {}
91+
self: "s1"
92+
services: []
93+
tests: []
94+
path: ""
95+
download: false
96+
generate: false
97+
inCi: false
98+
cmdType: "native"
99+
enableTesting: false
100+
inDocker: false
101+
keployContainer: "keploy-v3"
102+
keployNetwork: "keploy-network"
103+
104+
# Visit [https://keploy.io/docs/running-keploy/configuration-file/] to learn about using keploy through configration file.

java-dedup/keploy/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
/reports/
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Generated by Keploy (3-dev)
2+
version: api.keploy.io/v1beta1
3+
kind: Http
4+
name: test-10
5+
spec:
6+
metadata: {}
7+
req:
8+
method: GET
9+
proto_major: 1
10+
proto_minor: 1
11+
url: http://127.0.0.1:8080/items
12+
header:
13+
Accept: '*/*'
14+
Host: 127.0.0.1:8080
15+
User-Agent: curl/8.19.0
16+
body: ""
17+
timestamp: 2026-04-24T12:48:15.246997938+05:30
18+
resp:
19+
status_code: 200
20+
header:
21+
Content-Type: application/json
22+
Date: Fri, 24 Apr 2026 07:18:15 GMT
23+
body: '[{"id":"item1","name":"Laptop","price":1200.00},{"id":"item2","name":"Mouse","price":25.50},{"id":"item3","name":"Keyboard","price":75.00}]'
24+
status_message: OK
25+
proto_major: 0
26+
proto_minor: 0
27+
timestamp: 2026-04-24T12:48:15.25057105+05:30
28+
objects: []
29+
assertions:
30+
noise:
31+
header.Date: []
32+
created: 1777015095
33+
app_port: 8080
34+
curl: |
35+
curl --request GET \
36+
--url http://127.0.0.1:8080/items \
37+
--header 'Host: 127.0.0.1:8080' \
38+
--header 'User-Agent: curl/8.19.0' \
39+
--header 'Accept: */*' \
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Generated by Keploy (3-dev)
2+
version: api.keploy.io/v1beta1
3+
kind: Http
4+
name: test-100
5+
spec:
6+
metadata: {}
7+
req:
8+
method: GET
9+
proto_major: 1
10+
proto_minor: 1
11+
url: http://127.0.0.1:8080/healthz
12+
header:
13+
Accept: '*/*'
14+
Host: 127.0.0.1:8080
15+
User-Agent: curl/8.19.0
16+
body: ""
17+
timestamp: 2026-04-24T12:48:16.301192216+05:30
18+
resp:
19+
status_code: 200
20+
header:
21+
Content-Type: application/json
22+
Date: Fri, 24 Apr 2026 07:18:16 GMT
23+
body: '{"healthy":true}'
24+
status_message: OK
25+
proto_major: 0
26+
proto_minor: 0
27+
timestamp: 2026-04-24T12:48:16.303821826+05:30
28+
objects: []
29+
assertions:
30+
noise:
31+
header.Date: []
32+
created: 1777015096
33+
app_port: 8080
34+
curl: |
35+
curl --request GET \
36+
--url http://127.0.0.1:8080/healthz \
37+
--header 'User-Agent: curl/8.19.0' \
38+
--header 'Accept: */*' \
39+
--header 'Host: 127.0.0.1:8080' \
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Generated by Keploy (3-dev)
2+
version: api.keploy.io/v1beta1
3+
kind: Http
4+
name: test-101
5+
spec:
6+
metadata: {}
7+
req:
8+
method: GET
9+
proto_major: 1
10+
proto_minor: 1
11+
url: http://127.0.0.1:8080/status
12+
header:
13+
Accept: '*/*'
14+
Host: 127.0.0.1:8080
15+
User-Agent: curl/8.19.0
16+
body: ""
17+
timestamp: 2026-04-24T12:48:16.312328831+05:30
18+
resp:
19+
status_code: 200
20+
header:
21+
Content-Type: application/json
22+
Date: Fri, 24 Apr 2026 07:18:16 GMT
23+
body: '{"service":"user-api","status":"active"}'
24+
status_message: OK
25+
proto_major: 0
26+
proto_minor: 0
27+
timestamp: 2026-04-24T12:48:16.314716531+05:30
28+
objects: []
29+
assertions:
30+
noise:
31+
header.Date: []
32+
created: 1777015096
33+
app_port: 8080
34+
curl: |
35+
curl --request GET \
36+
--url http://127.0.0.1:8080/status \
37+
--header 'User-Agent: curl/8.19.0' \
38+
--header 'Accept: */*' \
39+
--header 'Host: 127.0.0.1:8080' \
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Generated by Keploy (3-dev)
2+
version: api.keploy.io/v1beta1
3+
kind: Http
4+
name: test-102
5+
spec:
6+
metadata: {}
7+
req:
8+
method: GET
9+
proto_major: 1
10+
proto_minor: 1
11+
url: http://127.0.0.1:8080/anybody
12+
header:
13+
Accept: '*/*'
14+
Host: 127.0.0.1:8080
15+
User-Agent: curl/8.19.0
16+
body: ""
17+
timestamp: 2026-04-24T12:48:16.322102113+05:30
18+
resp:
19+
status_code: 200
20+
header:
21+
Content-Type: application/json
22+
Date: Fri, 24 Apr 2026 07:18:16 GMT
23+
body: '{"message":"Anybody"}'
24+
status_message: OK
25+
proto_major: 0
26+
proto_minor: 0
27+
timestamp: 2026-04-24T12:48:16.324511112+05:30
28+
objects: []
29+
assertions:
30+
noise:
31+
header.Date: []
32+
created: 1777015096
33+
app_port: 8080
34+
curl: |
35+
curl --request GET \
36+
--url http://127.0.0.1:8080/anybody \
37+
--header 'Accept: */*' \
38+
--header 'Host: 127.0.0.1:8080' \
39+
--header 'User-Agent: curl/8.19.0' \
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Generated by Keploy (3-dev)
2+
version: api.keploy.io/v1beta1
3+
kind: Http
4+
name: test-103
5+
spec:
6+
metadata: {}
7+
req:
8+
method: GET
9+
proto_major: 1
10+
proto_minor: 1
11+
url: http://127.0.0.1:8080/noone
12+
header:
13+
Accept: '*/*'
14+
Host: 127.0.0.1:8080
15+
User-Agent: curl/8.19.0
16+
body: ""
17+
timestamp: 2026-04-24T12:48:16.333013067+05:30
18+
resp:
19+
status_code: 200
20+
header:
21+
Content-Type: application/json
22+
Date: Fri, 24 Apr 2026 07:18:16 GMT
23+
body: '{"message":"No one"}'
24+
status_message: OK
25+
proto_major: 0
26+
proto_minor: 0
27+
timestamp: 2026-04-24T12:48:16.335524182+05:30
28+
objects: []
29+
assertions:
30+
noise:
31+
header.Date: []
32+
created: 1777015096
33+
app_port: 8080
34+
curl: |
35+
curl --request GET \
36+
--url http://127.0.0.1:8080/noone \
37+
--header 'Accept: */*' \
38+
--header 'Host: 127.0.0.1:8080' \
39+
--header 'User-Agent: curl/8.19.0' \

0 commit comments

Comments
 (0)