1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00

Read applicationId also from configuration

This commit is contained in:
Marcus Holl 2018-08-03 12:41:50 +02:00
parent 8ee36e3c36
commit 45f4952c71
2 changed files with 36 additions and 5 deletions

View File

@ -177,6 +177,36 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
]
}
@Test
public void uploadFileToTransportRequestSuccessApplicationIdFromConfigurationTest() {
nullScript.commonPipelineEnvironment.configuration.put(['steps',
[transportRequestUploadFile:
[applicationId: 'AppIdfromConfig']]])
ChangeManagement cm = new ChangeManagement(nullScript) {
void uploadFileToTransportRequest(String changeId,
String transportRequestId,
String applicationId,
String filePath,
String endpoint,
String credentialsId,
String cmclientOpts) {
cmUtilReceivedParams.applicationId = applicationId
}
}
jsr.step.transportRequestUploadFile(
script: nullScript,
changeDocumentId: '001',
transportRequestId: '002',
filePath: '/path',
cmUtils: cm)
assert cmUtilReceivedParams.applicationId == 'AppIdfromConfig'
}
@Test
public void uploadFileToTransportRequestFilePathFromParameters() {

View File

@ -13,17 +13,18 @@ import hudson.AbortException
@Field def STEP_NAME = 'transportRequestUploadFile'
@Field Set generalConfigurationKeys = [
'changeManagement',
'changeManagement'
]
@Field Set parameterKeys = generalConfigurationKeys.plus([
'applicationId',
@Field Set stepConfigurationKeys = generalConfigurationKeys.plus([
'applicationId'
])
@Field Set parameterKeys = stepConfigurationKeys.plus([
'changeDocumentId',
'filePath',
'transportRequestId'])
@Field Set stepConfigurationKeys = generalConfigurationKeys
def call(parameters = [:]) {
handlePipelineStepErrors (stepName: STEP_NAME, stepParameters: parameters) {