Skip to content

Feature/integration tests#8

Merged
soraiayugulis merged 6 commits into
mainfrom
feature/integration-tests
Jun 12, 2026
Merged

Feature/integration tests#8
soraiayugulis merged 6 commits into
mainfrom
feature/integration-tests

Conversation

@soraiayugulis

Copy link
Copy Markdown
Owner

Summary

Adds comprehensive integration and end-to-end tests covering the full authorization pipeline, concurrent transaction handling, and all REST API endpoints via Spring context.

Changes

E2E Tests

  • AuthorizationFlowE2ETest — complete flow: register card → add balance → register merchant → authorize
    • Successful authorization with balance deduction
    • MEAL → FOOD fallback end-to-end
    • Denial flow with INSUFFICIENT_BALANCE
    • Daily limit enforcement across multiple transactions

Concurrent Tests

  • ConcurrentTransactionE2ETest — 10-thread concurrent authorization
    • Verifies no balance inconsistencies after concurrent transactions
    • Confirms sequential processing per card (5 threads, all approved)

API Integration Tests

  • ApiIntegrationTest@SpringBootTest with @AutoConfigureMockMvc
    • Tests all 8 endpoints in order via real HTTP calls
    • Verifies request/response serialization
    • Covers: POST /cards, POST /balance, GET /balance, POST /merchants, POST /transactions, GET /transactions, PUT /status, GET /cards/{id}

Configuration

  • AppConfig — Spring @Configuration wiring all repositories, validators, checkers, and services as beans

Tests

  • 114 total tests — all passing
  • 30 domain unit tests
  • 35 authorization service tests
  • 15 repository tests
  • 24 controller tests
  • 4 fraud detection tests
  • 4 E2E flow tests
  • 2 concurrent tests
  • 8 API integration tests

Success Criteria ✅

  • All domain models with proper validation
  • Authorization service with MEAL fallback
  • Daily transaction limit enforced
  • All REST API endpoints functional
  • Fraud detection decoupled and functional
  • All unit tests pass
  • All integration tests pass
  • All end-to-end tests pass
  • Hexagonal architecture maintained

@soraiayugulis soraiayugulis self-assigned this Jun 12, 2026
@soraiayugulis soraiayugulis added the good first issue Good for newcomers label Jun 12, 2026
@soraiayugulis soraiayugulis merged commit 725d9bf into main Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant