Skip to content

ivasilyev/test-stub-spring-boot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

test-stub-spring-boot

Spring Boot Test Stub.

Simple.

Get the program

curl -fsSL "$(
    curl -s "https://api.github.com/repos/ivasilyev/test-stub-spring-boot/releases/latest" \
    | grep -E '\"browser_download_url\":.*\.jar' \
    | sed -E 's/.*"([^"]+)".*/\1/' 
)" -o "test-stub-spring-boot.jar"

Run the program

JAVA_HOME="/path/to/java/home" \
"/path/to/java/bin" \
    -Xms1024m \
    -Xmx2048m \
    -jar "test-stub-spring-boot.jar"

Access test endpoint Web UI

http://hostname:10000/endpoint/ui

Access test endpoint via REST API

curl "http://hostname:10000/endpoint"

Change response delay time (in milliseconds)

curl \
    --request POST \
    --data-binary '{"delayMs":555}' \
    --header 'Content-Type: application/json' \
    "http://hostname:10000/endpoint/api/set-delay"

Access program monitoring metrics

curl "http://hostname:10000/actuator/prometheus"

Bonus: Recommended Grafana dashboards