Component template project for Java including Spring Boot 2 and JUnit
The goal of this template project is to have branches that are ready to go with different non-conflicting implementations for various things on-top of the master branch.
// Pull in the reference implementation for ActiveMQ
git pull origin with_activemq
// Pull in the reference implementation for PostgreSQL
git pull origin with_postgresql
// Pull in the reference implementation for Flyway DB Migrations
git pull origin with_flyway
List of branches:
Currently Implemented Quality Gates:
Gate Number | Description | Condition |
---|---|---|
1 | Unit Tests | 100% PASS |
2 | Integration Tests | 100% PASS |
3 | Jacoco (Code Coverage) | 100% BRANCH COVERAGE |
4 | SonarCloud (Static Analysis) | NOT IMPLEMENTED |
5 | Functional Tests | 100% PASS |
For development, it is suggested that you run using Gradle and bring up docker yourself.
$ docker-compose up -d
$ gradle test
$ docker-compose down
To run the unit/integration tests
$ make test
For functional tests, you should use make, which will build the application and docker container
$ make testFunctional
This runs the equivalent of
# Creates java executable
$ ./gradlew bootJar
# Builds the docker container
$ docker-compose -f docker-compose-test.yml build
# Launches the docker container
$ docker-compose -f docker-compose-test.yml up -d
# Waits for service locally
./scripts/wait-for-url.sh http://localhost:8080
# Runs the tests
$ ./gradlew functionalTest
# Tears down containers
$ docker-compose -f docker-compose-test.yml down
A list of Reference Implementations
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./build/reports/jacoco/test/jacocoUnitTestReport.xml
flags: unittests
name: codecov-umbrella
Set env variable
SPRING_PROFILES_ACTIVE=test