From 504e0c8916c898856643cdfface36b6623a6369a Mon Sep 17 00:00:00 2001 From: Sergio Freire Date: Sun, 10 Mar 2024 15:47:06 +0000 Subject: [PATCH] add integration tests coverage --- pom.xml | 127 ++++++++++++++---- src/test/java/app/getxray/xray/DummyTest.java | 14 ++ 2 files changed, 114 insertions(+), 27 deletions(-) create mode 100644 src/test/java/app/getxray/xray/DummyTest.java diff --git a/pom.xml b/pom.xml index 5575deb..3ecdbe3 100644 --- a/pom.xml +++ b/pom.xml @@ -51,11 +51,17 @@ 2.2.1 3.6.4 3.12.0 + 3.2.5 + 2.22.2 + 3.0.1 UTF-8 - - - 0.11.0 - 5.8.2 + 0.13.1 + 5.10.2 + 0.8.11 + ${project.build.directory}/jacoco-output/jacoco-unit-tests.exec + ${project.build.directory}/jacoco-output/jacoco-it-tests.exec + ${project.build.directory}/jacoco-output/merged.exec + -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${it.coverage.file},append=true @@ -96,16 +102,6 @@ 3.4.1 - - - com.github.tomakehurst wiremock-jre8-standalone @@ -159,25 +155,52 @@ + + + org.jacoco jacoco-maven-plugin - 0.8.8 + ${jacoco.version} + + + before-unit-test-execution + + prepare-agent + + + ${unit.coverage.file} + surefire.jacoco.args + + + + after-unit-test-execution + test + + report + + + ${unit.coverage.file} + ${project.reporting.outputDirectory}/jacoco-unit-test-coverage-report + + + before-integration-test-execution pre-integration-test - prepare-agent + prepare-agent-integration - ${project.build.directory}/jacoco-output/jacoco-integration-tests.exec + ${it.coverage.file} failsafe.jacoco.args + ${project.build.directory}/jacoco-dump + true - after-integration-test-execution post-integration-test @@ -185,18 +208,63 @@ report - ${project.build.directory}/jacoco-output/jacoco-integration-tests.exec - ${project.reporting.outputDirectory}/jacoco-integration-test-coverage-report + ${it.coverage.file} + ${project.reporting.outputDirectory}/jacoco-it-coverage-report + + merge-unit-and-integration + post-integration-test + + merge + + + + + ${project.build.directory}/jacoco-output/ + + *.exec + + + + merged.coverage.file + + + + create-merged-report + post-integration-test + + report + + + merged.coverage.file + ${project.reporting.outputDirectory}/jacoco-merged-test-coverage-report + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + ${surefire.jacoco.args} + + **/*Test.java + + + **/*IT.java + + + + org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + ${maven-gpg-plugin.version} sign-artifacts @@ -238,7 +306,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 2.22.2 + ${maven-failsafe-plugin.version} ${failsafe.jacoco.args} + + **/*IT.java + + + **/*Test.java + + + + ${jacoco.maven.opts} + diff --git a/src/test/java/app/getxray/xray/DummyTest.java b/src/test/java/app/getxray/xray/DummyTest.java new file mode 100644 index 0000000..bf71f03 --- /dev/null +++ b/src/test/java/app/getxray/xray/DummyTest.java @@ -0,0 +1,14 @@ +package app.getxray.xray; + +import org.junit.jupiter.api.Test; + +import app.getxray.xray.XrayResultsImporter.CloudBuilder; + +public class DummyTest { + + @Test + public void resultsImporterBuilderTest() { + CloudBuilder xrayImporterBuilder = new XrayResultsImporter.CloudBuilder("clientId", "clientSecret"); + xrayImporterBuilder.build(); + } +}