Skip to content

optivem/modern-acceptance-testing-in-legacy-code-java

Repository files navigation

Modern Acceptance Testing in Legacy Code (Java)

acceptance-stage

Prerequisites

  • Java 21
  • Docker Desktop
  • PowerShell 7+
  • Node 22+

Ensure you have JDK 21 installed

java -version

Check that JAVA_HOME is set correctly & points to your JDK 21 installation

echo $env:JAVA_HOME

Check that you have Powershell 7

$PSVersionTable.PSVersion

Run Everything

.\Run-SystemTests.ps1

This will:

  1. Build the Frontend (TypeScript compilation and bundling with Vite)
  2. Build the Backend (Java compilation and JAR creation)
  3. Start Docker containers (Frontend, Backend, PostgreSQL, & Mock External APIs)
  4. Wait for all services to be healthy
  5. Run all System Tests (API E2E, UI E2E, and Smoke Tests)

You can open these URLs in your browser:

Separate Commands

Run with Local Build (Default)

Builds locally and runs all system tests:

.\Run-SystemTests.ps1
# or explicitly:
.\Run-SystemTests.ps1 local

Run with Pipeline Images

Uses pre-built Docker images from registry:

.\Run-SystemTests.ps1 pipeline

Quick Test Re-run

Skip build/start phases and just run tests (assumes services are already running):

.\Run-SystemTests.ps1 -TestOnly

Note: The -TestOnly flag skips the build, stop, start, and wait phases. Use it when services are already running and you just want to re-run the tests quickly.

Individual Component Builds

You can also build components separately:

Backend:

cd backend
.\Build-Backend.ps1

Frontend:

cd frontend
.\Build-Frontend.ps1

Docker Commands

For manual Docker management:

View Logs:

docker compose -f docker-compose.local.yml logs
# or for pipeline:
docker compose -f docker-compose.pipeline.yml logs

Stop Services:

docker compose -f docker-compose.local.yml down
# or for pipeline:
docker compose -f docker-compose.pipeline.yml down

Service URLs:

You can open these URLs in your browser:

License

MIT License

This project is released under the MIT License.

Contributors

About

Modern Acceptance Testing in Legacy Code (Java)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •