From 7feecd1f07964c423aeab178f7887bc3fc7abdac Mon Sep 17 00:00:00 2001 From: "compmath03@gmail.com" Date: Sat, 21 Jun 2025 11:05:46 +0530 Subject: [PATCH 1/2] feat: add spring-notes sample app integrated with Keploy Signed-off-by: Pratham0320 --- keploy-logs.txt | 8 +++ keploy.yml | 67 +++++++++++++++++++ spring-notes/spring-notes/README.md | 7 ++ spring-notes/spring-notes/pom.xml | 38 +++++++++++ .../src/main/java/com/keploy/notes/Note.java | 0 .../java/com/keploy/notes/NoteController.java | 0 .../keploy/notes/SpringNotesApplication.java | 0 7 files changed, 120 insertions(+) create mode 100644 keploy-logs.txt create mode 100644 keploy.yml create mode 100644 spring-notes/spring-notes/README.md create mode 100644 spring-notes/spring-notes/pom.xml create mode 100644 spring-notes/spring-notes/src/main/java/com/keploy/notes/Note.java create mode 100644 spring-notes/spring-notes/src/main/java/com/keploy/notes/NoteController.java create mode 100644 spring-notes/spring-notes/src/main/java/com/keploy/notes/SpringNotesApplication.java diff --git a/keploy-logs.txt b/keploy-logs.txt new file mode 100644 index 00000000..3cfbbe04 --- /dev/null +++ b/keploy-logs.txt @@ -0,0 +1,8 @@ +🐰 Keploy: 2025-06-21T11:03:47+05:30 ERROR Error removing file {"error": "remove keploy-logs.txt: The process cannot access the file because it is being used by another process."} +🐰 Keploy: 2025-06-21T11:03:47+05:30 ERROR Failed to delete Keploy Logs {"error": "remove keploy-logs.txt: The process cannot access the file because it is being used by another process."} +🐰 Keploy: 2025-06-21T11:03:53+05:30 INFO config file not found; proceeding with flags only +🐰 Keploy: 2025-06-21T11:03:53+05:30 INFO Using the last directory name as appName : samples-java +🐰 Keploy: 2025-06-21T11:03:53+05:30 INFO Generated config file based on the flags that are used +🐰 Keploy: 2025-06-21T11:03:53+05:30 ERROR failed to get service {"command": "record", "error": "command not supported in non linux os. if you are on windows or mac, please use the dockerized version of your application"} +🐰 Keploy: 2025-06-21T11:03:53+05:30 ERROR Error removing file {"error": "remove keploy-logs.txt: The process cannot access the file because it is being used by another process."} +🐰 Keploy: 2025-06-21T11:03:53+05:30 ERROR Failed to delete Keploy Logs {"error": "remove keploy-logs.txt: The process cannot access the file because it is being used by another process."} diff --git a/keploy.yml b/keploy.yml new file mode 100644 index 00000000..6513aba6 --- /dev/null +++ b/keploy.yml @@ -0,0 +1,67 @@ +# Generated by Keploy (2.6.12) +path: "" +appId: 0 +appName: samples-java +command: mvn spring-boot:run +templatize: + testSets: [] +port: 0 +e2e: false +dnsPort: 26789 +proxyPort: 16789 +debug: false +disableTele: false +disableANSI: false +containerName: "" +networkName: "" +buildDelay: 30 +test: + selectedTests: {} + globalNoise: + global: {} + test-sets: {} + delay: 5 + host: "" + port: 0 + apiTimeout: 5 + skipCoverage: false + coverageReportPath: "" + ignoreOrdering: true + mongoPassword: default@123 + language: "" + removeUnusedMocks: false + fallBackOnMiss: false + jacocoAgentPath: "" + basePath: "" + mocking: true + ignoredTests: {} + disableLineCoverage: false + disableMockUpload: true + useLocalMock: false + updateTemplate: false + mustPass: false + maxFailAttempts: 5 + maxFlakyChecks: 1 +record: + filters: [] + basePath: "" + recordTimer: 0s +configPath: "" +bypassRules: [] +generateGithubActions: false +keployContainer: keploy-v2 +keployNetwork: keploy-network +cmdType: native +contract: + services: [] + tests: [] + path: "" + download: false + generate: false + driven: consumer + mappings: + servicesMapping: {} + self: s1 +inCi: false + +# Visit [https://keploy.io/docs/running-keploy/configuration-file/] to learn about using keploy through configration file. diff --git a/spring-notes/spring-notes/README.md b/spring-notes/spring-notes/README.md new file mode 100644 index 00000000..6cf4530f --- /dev/null +++ b/spring-notes/spring-notes/README.md @@ -0,0 +1,7 @@ +# Spring Notes App + +A minimal Spring Boot Notes API app integrated with Keploy. + +## 🛠 Run app +```bash +mvn spring-boot:run diff --git a/spring-notes/spring-notes/pom.xml b/spring-notes/spring-notes/pom.xml new file mode 100644 index 00000000..ede44559 --- /dev/null +++ b/spring-notes/spring-notes/pom.xml @@ -0,0 +1,38 @@ + + 4.0.0 + com.keploy + spring-notes + 1.0.0 + jar + + + org.springframework.boot + spring-boot-starter-parent + 3.2.5 + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.projectlombok + lombok + true + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + diff --git a/spring-notes/spring-notes/src/main/java/com/keploy/notes/Note.java b/spring-notes/spring-notes/src/main/java/com/keploy/notes/Note.java new file mode 100644 index 00000000..e69de29b diff --git a/spring-notes/spring-notes/src/main/java/com/keploy/notes/NoteController.java b/spring-notes/spring-notes/src/main/java/com/keploy/notes/NoteController.java new file mode 100644 index 00000000..e69de29b diff --git a/spring-notes/spring-notes/src/main/java/com/keploy/notes/SpringNotesApplication.java b/spring-notes/spring-notes/src/main/java/com/keploy/notes/SpringNotesApplication.java new file mode 100644 index 00000000..e69de29b From 87f96f39f2255e60088e0bda54c11908b119f8b2 Mon Sep 17 00:00:00 2001 From: Pratham0320 Date: Sat, 21 Jun 2025 11:46:48 +0530 Subject: [PATCH 2/2] Minor Changes --- .../src/main/java/com/keploy/notes/Note.java | 6 +++++ .../java/com/keploy/notes/NoteController.java | 26 +++++++++++++++++++ .../keploy/notes/SpringNotesApplication.java | 11 ++++++++ 3 files changed, 43 insertions(+) diff --git a/spring-notes/spring-notes/src/main/java/com/keploy/notes/Note.java b/spring-notes/spring-notes/src/main/java/com/keploy/notes/Note.java index e69de29b..df334321 100644 --- a/spring-notes/spring-notes/src/main/java/com/keploy/notes/Note.java +++ b/spring-notes/spring-notes/src/main/java/com/keploy/notes/Note.java @@ -0,0 +1,6 @@ +package com.keploy.notes; + +public class Note { + public int id; + public String content; +} diff --git a/spring-notes/spring-notes/src/main/java/com/keploy/notes/NoteController.java b/spring-notes/spring-notes/src/main/java/com/keploy/notes/NoteController.java index e69de29b..cf1cf125 100644 --- a/spring-notes/spring-notes/src/main/java/com/keploy/notes/NoteController.java +++ b/spring-notes/spring-notes/src/main/java/com/keploy/notes/NoteController.java @@ -0,0 +1,26 @@ +package com.keploy.notes; + +import org.springframework.web.bind.annotation.*; +import java.util.*; + +@RestController +@RequestMapping("/notes") +public class NoteController { + private final Map notes = new HashMap<>(); + + @PostMapping + public Note create(@RequestBody Note note) { + notes.put(note.id, note); + return note; + } + + @GetMapping + public Collection getAll() { + return notes.values(); + } + + @GetMapping("/{id}") + public Note get(@PathVariable int id) { + return notes.get(id); + } +} diff --git a/spring-notes/spring-notes/src/main/java/com/keploy/notes/SpringNotesApplication.java b/spring-notes/spring-notes/src/main/java/com/keploy/notes/SpringNotesApplication.java index e69de29b..1364be5d 100644 --- a/spring-notes/spring-notes/src/main/java/com/keploy/notes/SpringNotesApplication.java +++ b/spring-notes/spring-notes/src/main/java/com/keploy/notes/SpringNotesApplication.java @@ -0,0 +1,11 @@ +package com.keploy.notes; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpringNotesApplication { + public static void main(String[] args) { + SpringApplication.run(SpringNotesApplication.class, args); + } +}