diff --git a/test/groovy/ChecksPublishResultsTest.groovy b/test/groovy/ChecksPublishResultsTest.groovy index 016b30f06..9546e3314 100644 --- a/test/groovy/ChecksPublishResultsTest.groovy +++ b/test/groovy/ChecksPublishResultsTest.groovy @@ -65,6 +65,22 @@ class ChecksPublishResultsTest extends BasePipelineTest { assertTrue("WarningsPublisher options not empty", publisherStepOptions['WarningsPublisher'] == null) } + @Test + void testPublishForJavaWithChangedDefaultSettings() throws Exception { + // pmd has been set to active: true in step configuration + stepUnderTest.call() + //TODO: add rule to load different pipeline config + //TODO: adapt isMap to not override the step config + + assertTrue("AnalysisPublisher options not set", publisherStepOptions['AnalysisPublisher'] != null) + assertTrue("PmdPublisher options not set", publisherStepOptions['PmdPublisher'] != null) + // ensure nothing else is published + assertTrue("DryPublisher options not empty", publisherStepOptions['DryPublisher'] == null) + assertTrue("FindBugsPublisher options not empty", publisherStepOptions['FindBugsPublisher'] == null) + assertTrue("CheckStylePublisher options not empty", publisherStepOptions['CheckStylePublisher'] == null) + assertTrue("WarningsPublisher options not empty", publisherStepOptions['WarningsPublisher'] == null) + } + @Test void testPublishForJavaScriptWithDefaultSettings() throws Exception { stepUnderTest.call(eslint: true) diff --git a/test/resources/ChecksPublishResults/test_pipeline_config.yml b/test/resources/ChecksPublishResults/test_pipeline_config.yml new file mode 100644 index 000000000..658f8b49a --- /dev/null +++ b/test/resources/ChecksPublishResults/test_pipeline_config.yml @@ -0,0 +1,11 @@ +#Project Setup +general: + productiveBranch: 'develop' + +#Steps Specific Configuration +steps: + mavenExecute: + dockerImage: 'my-maven-docker' + checksPublishResults: + pmd: + active: true