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:
parent
8ee36e3c36
commit
45f4952c71
@ -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() {
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user