Skip to content

feat: add spring-notes sample app integrated with Keploy #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions keploy-logs.txt
Original file line number Diff line number Diff line change
@@ -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."}
67 changes: 67 additions & 0 deletions keploy.yml
Original file line number Diff line number Diff line change
@@ -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.
7 changes: 7 additions & 0 deletions spring-notes/spring-notes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Spring Notes App

A minimal Spring Boot Notes API app integrated with Keploy.

## 🛠 Run app
```bash
mvn spring-boot:run
38 changes: 38 additions & 0 deletions spring-notes/spring-notes/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.keploy</groupId>
<artifactId>spring-notes</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<relativePath/>
</parent>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.keploy.notes;

public class Note {
public int id;
public String content;
}
Original file line number Diff line number Diff line change
@@ -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<Integer, Note> notes = new HashMap<>();

@PostMapping
public Note create(@RequestBody Note note) {
notes.put(note.id, note);
return note;
}

@GetMapping
public Collection<Note> getAll() {
return notes.values();
}

@GetMapping("/{id}")
public Note get(@PathVariable int id) {
return notes.get(id);
}
}
Original file line number Diff line number Diff line change
@@ -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);
}
}