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

Provide test for transport request create rfc fails

This commit is contained in:
Marcus Holl 2019-01-31 14:02:54 +01:00
parent 53ae89d16f
commit 6a6e075da8
2 changed files with 36 additions and 10 deletions

View File

@ -114,17 +114,24 @@ public class ChangeManagement implements Serializable {
"--env TRANSPORT_DESCRIPTION=${description}",
"--env ABAP_DEVELOPMENT_CLIENT=${client}"]
def transportRequestId = executeWithCredentials(
BackendType.RFC,
dockerImage,
dockerOptions,
endpoint,
credentialsId,
command,
args,
true)
try {
return new JsonSlurper().parseText(transportRequestId).REQUESTID
def transportRequestId = executeWithCredentials(
BackendType.RFC,
dockerImage,
dockerOptions,
endpoint,
credentialsId,
command,
args,
true)
return new JsonSlurper().parseText(transportRequestId).REQUESTID
} catch(AbortException ex) {
throw new ChangeManagementException(
"Cannot create transport request: ${ex.getMessage()}", ex)
}
}
void uploadFileToTransportRequestSOLMAN(

View File

@ -199,6 +199,25 @@ public void testGetCommandLineWithCMClientOpts() {
}
@Test
public void testCreateTransportRequestRFCFails() {
thrown.expect(ChangeManagementException)
thrown.expectMessage('Cannot create transport request: script returned exit code 3')
script.setReturnValue('cts createTransportRequest',
{ throw new AbortException('script returned exit code 3')})
def transportRequestId = new ChangeManagement(nullScript).createTransportRequestRFC(
'rfc', // docker image
[], // docker options
'https://example.org/rfc', // endpoint
'01', // client
'me', // credentialsId
'Lorem ipsum' // description
)
}
@Test
public void testCreateTransportRequestCTSSucceeds() {