mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-01-30 05:59:39 +02:00
Merge pull request #238 from marcusholl/pr/transportRequestUploadFilewithMtarFileFromCPE
Take mtarFilePath in commonPipelineEnviroment into account
This commit is contained in:
commit
f190f05ec5
@ -181,6 +181,65 @@ public class TransportRequestUploadFileTest extends BasePiperTest {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void uploadFileToTransportRequestFilePathFromParameters() {
|
||||||
|
|
||||||
|
// this one is not used when file path is provided via signature
|
||||||
|
nullScript.commonPipelineEnvironment.setMtarFilePath('/path2')
|
||||||
|
|
||||||
|
ChangeManagement cm = new ChangeManagement(nullScript) {
|
||||||
|
void uploadFileToTransportRequest(String changeId,
|
||||||
|
String transportRequestId,
|
||||||
|
String applicationId,
|
||||||
|
String filePath,
|
||||||
|
String endpoint,
|
||||||
|
String username,
|
||||||
|
String password,
|
||||||
|
String cmclientOpts) {
|
||||||
|
|
||||||
|
cmUtilReceivedParams.filePath = filePath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jsr.step.call(script: nullScript,
|
||||||
|
changeDocumentId: '001',
|
||||||
|
transportRequestId: '002',
|
||||||
|
applicationId: 'app',
|
||||||
|
filePath: '/path',
|
||||||
|
cmUtils: cm)
|
||||||
|
|
||||||
|
assert cmUtilReceivedParams.filePath == '/path'
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void uploadFileToTransportRequestFilePathFromCommonPipelineEnvironment() {
|
||||||
|
|
||||||
|
// this one is used since there is nothing in the signature
|
||||||
|
nullScript.commonPipelineEnvironment.setMtarFilePath('/path2')
|
||||||
|
|
||||||
|
ChangeManagement cm = new ChangeManagement(nullScript) {
|
||||||
|
void uploadFileToTransportRequest(String changeId,
|
||||||
|
String transportRequestId,
|
||||||
|
String applicationId,
|
||||||
|
String filePath,
|
||||||
|
String endpoint,
|
||||||
|
String username,
|
||||||
|
String password,
|
||||||
|
String cmclientOpts) {
|
||||||
|
|
||||||
|
cmUtilReceivedParams.filePath = filePath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jsr.step.call(script: nullScript,
|
||||||
|
changeDocumentId: '001',
|
||||||
|
transportRequestId: '002',
|
||||||
|
applicationId: 'app',
|
||||||
|
cmUtils: cm)
|
||||||
|
|
||||||
|
assert cmUtilReceivedParams.filePath == '/path2'
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void uploadFileToTransportRequestUploadFailureTest() {
|
public void uploadFileToTransportRequestUploadFailureTest() {
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ def call(parameters = [:]) {
|
|||||||
.mixinStageConfig(script.commonPipelineEnvironment, parameters.stageName?:env.STAGE_NAME, stepConfigurationKeys)
|
.mixinStageConfig(script.commonPipelineEnvironment, parameters.stageName?:env.STAGE_NAME, stepConfigurationKeys)
|
||||||
.mixinStepConfig(script.commonPipelineEnvironment, stepConfigurationKeys)
|
.mixinStepConfig(script.commonPipelineEnvironment, stepConfigurationKeys)
|
||||||
.mixin(parameters, parameterKeys)
|
.mixin(parameters, parameterKeys)
|
||||||
|
.addIfEmpty('filePath', script.commonPipelineEnvironment.getMtarFilePath())
|
||||||
.withMandatoryProperty('applicationId')
|
.withMandatoryProperty('applicationId')
|
||||||
.withMandatoryProperty('changeManagement/changeDocumentLabel')
|
.withMandatoryProperty('changeManagement/changeDocumentLabel')
|
||||||
.withMandatoryProperty('changeManagement/clientOpts')
|
.withMandatoryProperty('changeManagement/clientOpts')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user