From 74a06ef871fb36dff04f13e53b9d355b0d7c6615 Mon Sep 17 00:00:00 2001 From: Sven Merk Date: Tue, 12 Mar 2019 11:53:23 +0100 Subject: [PATCH] Fix test --- .../WhitesourceConfigurationHelper.groovy | 19 +++++++++++++++---- test/groovy/WhitesourceExecuteScanTest.groovy | 3 +++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/com/sap/piper/WhitesourceConfigurationHelper.groovy b/src/com/sap/piper/WhitesourceConfigurationHelper.groovy index 21b793b36..e55195fa4 100644 --- a/src/com/sap/piper/WhitesourceConfigurationHelper.groovy +++ b/src/com/sap/piper/WhitesourceConfigurationHelper.groovy @@ -39,11 +39,7 @@ class WhitesourceConfigurationHelper implements Serializable { [name: 'resolveAllDependencies', value: false] ] switch (config.scanType) { - case 'maven': - mapping += [ - ] - break case 'npm': mapping += [ @@ -72,6 +68,21 @@ class WhitesourceConfigurationHelper implements Serializable { ] break + case 'golang': + mapping += [ + + ] + break + case 'dlang': + mapping += [ + + ] + break + default: + // maven + mapping += [ + + ] } rewriteConfiguration(script, utils, config, mapping, suffix, path, inputFile, targetFile, parsingClosure, serializationClosure) diff --git a/test/groovy/WhitesourceExecuteScanTest.groovy b/test/groovy/WhitesourceExecuteScanTest.groovy index 0b827cb1e..a3e289751 100644 --- a/test/groovy/WhitesourceExecuteScanTest.groovy +++ b/test/groovy/WhitesourceExecuteScanTest.groovy @@ -125,6 +125,9 @@ class WhitesourceExecuteScanTest extends BasePiperTest { helper.registerAllowedMethod( "fetchVulnerabilities", [List], { return new JsonUtils().parseJsonSerializable("{ \"alerts\": [] }").alerts }) + helper.registerAllowedMethod( "createProduct", [], { + return new JsonUtils().parseJsonSerializable("{ \"productToken\": \"e30132d8e8f04a4c8be6332c75a0ff0580ab326fa7534540ad326e97a74d945b\" }") + }) helper.registerAllowedMethod( "publishHTML", [Map], {}) helper.registerAllowedMethod( "getNpmGAV", [String], {return [group: 'com.sap.node', artifact: 'test-node', version: '1.2.3']})