Skip to content

Latest commit

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

SpecShield Test API

A minimal Spring Boot REST API used to test the SpecShield GitHub Integration end-to-end.

What This Project Tests

Test CaseScenarioExpected SpecShield Result
TC-01Install GitHub AppInstallation appears on dashboard
TC-02PR with no spec changesSilent pass — no comment
TC-03PR adds new endpointsPass + additions comment
TC-04PR removes required field + endpointFAIL — PR blocked
TC-05Spec added for first timeNeutral — no base to compare
TC-06Wrong spec path configuredSkipped — spec not found
TC-07Push second commit to open PRNew check run triggered
TC-08Invalid webhook signature401 rejected
TC-09Spec missing on both branchesSkipped
TC-10Spec deleted on PR branchFAIL — spec deleted
TC-11Repo check disabledNo check run at all
TC-12Breaking change + fail-on-breaking=falsePass with warning comment

Quick Start Modified

1. Push this project to GitHub

cd /Users/deepaksatyam/IntellijProject/claude/test_projects/specshield-test-api
git init
git add .
git commit -m "initial: SpecShield test project with baseline openapi.yaml"
git branch -M main
git remote add origin https://github.com/YOUR_USERNAME/specshield-test-api.git
git push -u origin main

2. Install the SpecShield GitHub App

  • Go to https://specshield.io/account/github
  • Click "Install GitHub App"
  • Select specshield-test-api repository
  • Click Install

3. Create All Test Branches

bash test-scenarios/setup-all-branches.sh

4. Push All Branches

git push origin --all

5. Open Pull Requests

Open a PR for each branch → main on GitHub, and watch SpecShield check runs appear.


Running the API Locally

./mvnw spring-boot:run

The API runs at http://localhost:8080.

Endpoints

MethodPathDescription
GET/usersList all users
GET/users/{id}Get user by ID
POST/usersCreate a user
DELETE/users/{id}Delete a user

Example

# Get all users
curl http://localhost:8080/users
# Create a user
curl -X POST http://localhost:8080/users \
-H "Content-Type: application/json" \
-d '{"name":"Charlie Brown","email":"charlie@example.com"}'

Project Structure

specshield-test-api/
├── openapi.yaml ← Baseline v1.0 spec (on main)
├── pom.xml
├── src/main/java/com/example/testapi/
│ ├── TestApiApplication.java
│ ├── controller/UserController.java
│ └── model/User.java
└── test-scenarios/
├── setup-all-branches.sh ← Run this to create all test branches
├── tc07-push-second-commit.sh ← Run after opening TC-07 PR
├── tc08-invalid-signature.sh ← Sends bad webhook, expects 401
├── TC05-INSTRUCTIONS.md ← Manual steps for TC-05
├── tc03-nonbreaking/openapi.yaml ← Adds /products (non-breaking)
└── tc04-breaking/openapi.yaml ← Removes email field (breaking)

API Versions

VersionFileChanges
v1.0.0openapi.yaml (main)Baseline: /users, /users/{id}
v1.1.0tc03-nonbreaking/openapi.yamlAdds /products, /products/{id}
v2.0.0tc04-breaking/openapi.yamlRemoves email field + DELETE /users/{id}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages