- clone the project
git clone <repo-url>- change directory
cd teamsync-backend- Create an env with the following secrets
azure.storage.connection-string=${AZURE_CONNECTION_STRING}
azure.storage.container-name=${AZURE_CONTAINER_NAME}
azure.storage.account-name=${AZURE_ACCOUNT_NAME}
azure.storage.sas-token=${AZURE_SAS_TOKEN}- run the docker container - it will create all the necessary tables and populate them
docker compose up -d
- verify table creation
- connect with the container
docker exec -it <container-name> psql -U postgres -d postgres
it will open psql in command line like this-
postgres=#
To see the tables -
\dtYou should see something like this-
List of relations
Schema | Name | Type | Owner
--------+-------------------------+-------+----------
public | appreciations | table | postgres
public | channels | table | postgres
public | channels_members | table | postgres
public | comments | table | postgres
public | events | table | postgres
public | events_participants | table | postgres
public | feed_posts | table | postgres
public | feed_posts_media_urls | table | postgres
public | feed_posts_poll_options | table | postgres
public | feedposts | table | postgres
public | flyway_schema_history | table | postgres
public | messages | table | postgres
public | poll_votes | table | postgres
public | pollvotes | table | postgres- run the tomcat server
./setup.sh- healthcheck
send a get request to http://localhost:8080/api/v1/health
You should see
I am healthyTo run all unit tests:
./mvnw clean testThis command will:
- Clean the previous build artifacts
- Compile the source code
- Run all unit tests
- Generate JaCoCo coverage data
To generate a detailed HTML coverage report:
./mvnw jacoco:reportThis will create an HTML report at: target/site/jacoco/index.html
To run tests and generate the coverage report in a single command:
./mvnw clean test jacoco:reportAfter running the tests and generating the report, you can:
- Open the HTML report: Navigate to
target/site/jacoco/index.htmlin your browser - View coverage metrics: The report shows:
- Instructions: Bytecode instructions covered by tests
- Branches: Decision points (if/else, switch) covered by tests
- Lines: Source code lines covered by tests
- Methods: Methods called by tests
- Classes: Classes touched by tests
The JaCoCo report provides:
- Package-level coverage: Overall coverage for each package
- Class-level coverage: Detailed coverage for each class
- Method-level coverage: Line-by-line coverage within methods
- Color-coded coverage: Green (covered), red (not covered), yellow (partially covered)
Test results are also available in:
target/surefire-reports/- Detailed test execution reports- Console output - Summary of test execution
This project uses GitHub Actions for continuous integration. The CI pipeline:
- Database Setup: Starts PostgreSQL and runs Flyway migrations
- Test Execution: Runs all 1,037 unit tests with JaCoCo coverage
- Coverage Report: Generates detailed HTML coverage reports
- Build Verification: Ensures the application builds successfully
- Artifact Upload: Stores test results and coverage reports as artifacts
- JaCoCo Coverage Report: HTML coverage report available for download
- Test Results: Detailed test execution reports
- Build Artifacts: Compiled application JAR files
- CI Status: Check the badges above for current build status
- Coverage Report: Download the
jacoco-coverage-reportartifact from GitHub Actions - Test Results: Download the
test-resultsartifact for detailed test information
- Local: Run
./mvnw clean test jacoco:reportfor local testing - CI: Automatically runs on every push to master and pull requests