diff --git a/build-info-extractor-gradle/src/test/java/org/jfrog/gradle/plugin/artifactory/GradlePluginTest.java b/build-info-extractor-gradle/src/test/java/org/jfrog/gradle/plugin/artifactory/GradlePluginTest.java index fc61ec4c4..b159afa5a 100644 --- a/build-info-extractor-gradle/src/test/java/org/jfrog/gradle/plugin/artifactory/GradlePluginTest.java +++ b/build-info-extractor-gradle/src/test/java/org/jfrog/gradle/plugin/artifactory/GradlePluginTest.java @@ -73,6 +73,7 @@ public void publicationsTest(String gradleVersion) throws IOException { BuildResult buildResult = runGradle(gradleVersion, envVars, false); // Check results checkBuildResults(artifactoryManager, buildResult, VersionNumber.parse(gradleVersion).getMajor() >= 6, localRepo1); + checkBuildInfoProps(artifactoryManager, buildResult); // Cleanup Pair buildDetails = getBuildDetails(buildResult); cleanTestBuilds(buildDetails.getLeft(), buildDetails.getRight(), null); diff --git a/build-info-extractor-gradle/src/test/java/org/jfrog/gradle/plugin/artifactory/Utils.java b/build-info-extractor-gradle/src/test/java/org/jfrog/gradle/plugin/artifactory/Utils.java index ef82742cc..1825d601b 100644 --- a/build-info-extractor-gradle/src/test/java/org/jfrog/gradle/plugin/artifactory/Utils.java +++ b/build-info-extractor-gradle/src/test/java/org/jfrog/gradle/plugin/artifactory/Utils.java @@ -8,6 +8,7 @@ import org.gradle.testkit.runner.BuildResult; import org.gradle.testkit.runner.BuildTask; import org.gradle.testkit.runner.GradleRunner; +import org.jfrog.build.api.Artifact; import org.jfrog.build.api.Build; import org.jfrog.build.api.Dependency; import org.jfrog.build.api.Module; @@ -243,6 +244,26 @@ private static void checkBuildInfoModules(Build buildInfo, int expectedModules, } } + /** + * Check expected build info properties is found on each published artifacts. + * + * @param artifactoryManager - ArtifactoryManager client + * @param buildResult - The build results + */ + static void checkBuildInfoProps(ArtifactoryManager artifactoryManager, BuildResult buildResult) throws IOException { + Build buildInfo = getBuildInfo(artifactoryManager, buildResult); + for (Module module : buildInfo.getModules()) { + for (Artifact artifact : module.getArtifacts()) { + Properties properties = artifact.getProperties(); + assertNotNull(properties); + assertEquals(properties.getProperty("qa.level"), "basic"); + assertEquals(properties.getProperty("q.os"), "win32"); + assertEquals(properties.getProperty("q.os"), "deb"); + assertEquals(properties.getProperty("q.os"), "osx"); + } + } + } + /** * Assert build success for task. *