Skip to content

Latest commit

 

History

History
101 lines (81 loc) · 1.9 KB

File metadata and controls

101 lines (81 loc) · 1.9 KB

API Testing Collection

Product Service Tests

1. Create Product

curl -X POST http://localhost:8081/api/v1/products \
  -H "Content-Type: application/json" \
  -d '{
    "sku": "LAPTOP-001",
    "name": "Gaming Laptop",
    "description": "High-performance gaming laptop",
    "price": 1299.99,
    "stock": 50,
    "categoryId": 1
  }'

2. Get Product

curl http://localhost:8081/api/v1/products/1

3. Search Products

curl "http://localhost:8081/api/v1/products?keyword=laptop&page=0&size=10"

4. Update Stock

curl -X PUT "http://localhost:8081/api/v1/products/1/stock?quantity=5"

Order Service Tests

1. Create Order

curl -X POST http://localhost:8082/api/v1/orders \
  -H "Content-Type: application/json" \
  -d '{
    "customerId": 101,
    "items": [
      {
        "productId": 1,
        "productName": "Gaming Laptop",
        "quantity": 1,
        "price": 1299.99
      }
    ]
  }'

2. Get Order

curl http://localhost:8082/api/v1/orders/ORD-1734158400000-abc123de

3. Confirm Payment

curl -X POST http://localhost:8082/api/v1/orders/ORD-1734158400000-abc123de/pay

4. Ship Order

curl -X POST http://localhost:8082/api/v1/orders/ORD-1734158400000-abc123de/ship

BFF Service Tests

1. Prepare Checkout

curl -X POST "http://localhost:8083/api/v1/bff/checkout?customerId=101" \
  -H "Content-Type: application/json" \
  -d '[1, 2, 3]'

Health Checks

# Product Service
curl http://localhost:8081/actuator/health

# Order Service
curl http://localhost:8082/actuator/health

# BFF Service
curl http://localhost:8083/actuator/health

Metrics

# Product Service Metrics
curl http://localhost:8081/actuator/prometheus

# Order Service Metrics
curl http://localhost:8082/actuator/prometheus

# BFF Service Metrics
curl http://localhost:8083/actuator/prometheus