fishey2 / java-component-template

A template project for Java based projects with Spring Boot 2, Gradle, Logback and JUnit5
MIT License
7 stars 0 forks source link

Separate out unit and integration tests when running test #4

Open fishey2 opened 4 years ago

fishey2 commented 4 years ago

Currently the unit and integration tests are run together and can be identified by:

Unit: **/*Test.java Integration: **/*TestIT.java

These should be run separately, as dependencies on databases/message queues etc. are not required for unit testing.

The Jacoco configuration needs updating to merge the reports when running in the pipeline.

Both need to be sent to Sonarqube and CodeCov (with_codecov)

Acceptance Criteria:

Given that I have a unit test (*/Test.java) When I run ./gradlew test Then it will run only the unit test And it will not run the integration test

Given that I have an integration test (*/IT.java) When I run ./gradlew integrationTest Then it will run only the integration test And it will not run the integration test

Given that I have unit and integration tests When I run ./gradlew test And I run ./gradlw integrationTest And I run ./jacocoTestReport Then a report will be generated containing the results for the unit and integration tests together