diff --git a/test/groovy/CommonStepsTest.groovy b/test/groovy/CommonStepsTest.groovy index da24a3c8f..77ac6137d 100644 --- a/test/groovy/CommonStepsTest.groovy +++ b/test/groovy/CommonStepsTest.groovy @@ -216,7 +216,6 @@ public class CommonStepsTest extends BasePiperTest{ def stepsWithCallMethodsOtherThanVoid = [] def whitelist = [ - 'transportRequestCreate', 'durationMeasure', ] diff --git a/test/groovy/TransportRequestCreateTest.groovy b/test/groovy/TransportRequestCreateTest.groovy index a7170699e..93ae975f5 100644 --- a/test/groovy/TransportRequestCreateTest.groovy +++ b/test/groovy/TransportRequestCreateTest.groovy @@ -127,9 +127,9 @@ public class TransportRequestCreateTest extends BasePiperTest { } } - def transportId = jsr.step.call(script: nullScript, changeDocumentId: '001', developmentSystemId: '001', cmUtils: cm) + jsr.step.call(script: nullScript, changeDocumentId: '001', developmentSystemId: '001', cmUtils: cm) - assert transportId == '001' + assert nullScript.commonPipelineEnvironment.getTransportRequestId() == '001' assert result == [changeId: '001', developmentSystemId: '001', cmEndpoint: 'https://example.org/cm', @@ -166,14 +166,14 @@ public class TransportRequestCreateTest extends BasePiperTest { } } - def transportId = jsr.step.call(script: nullScript, - transportType: 'W', - targetSystem: 'XYZ', - description: 'desc', - changeManagement: [type: 'CTS'], - cmUtils: cm) + jsr.step.call(script: nullScript, + transportType: 'W', + targetSystem: 'XYZ', + description: 'desc', + changeManagement: [type: 'CTS'], + cmUtils: cm) - assert transportId == '001' + assert nullScript.commonPipelineEnvironment.getTransportRequestId() == '001' assert result == [transportType: 'W', targetSystemId: 'XYZ', description: 'desc', diff --git a/vars/transportRequestCreate.groovy b/vars/transportRequestCreate.groovy index c697fa5e0..edc0f908d 100644 --- a/vars/transportRequestCreate.groovy +++ b/vars/transportRequestCreate.groovy @@ -27,7 +27,7 @@ import hudson.AbortException @Field Set PARAMETER_KEYS = STEP_CONFIG_KEYS.plus(['changeDocumentId']) -def call(parameters = [:]) { +void call(parameters = [:]) { def transportRequestId @@ -112,5 +112,4 @@ def call(parameters = [:]) { echo "[INFO] Transport Request '$transportRequestId' has been successfully created." script.commonPipelineEnvironment.setTransportRequestId(transportRequestId) } - transportRequestId }