1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-03-03 15:02:35 +02:00

Test for RFC transportRequestCreate

This commit is contained in:
Marcus Holl 2019-02-14 12:01:28 +01:00
parent 80bd4cf11c
commit 02e832b008
2 changed files with 65 additions and 2 deletions

View File

@ -1,3 +1,5 @@
import java.util.Map
import org.junit.Before
import org.junit.Rule
import org.junit.Test
@ -186,6 +188,65 @@ public class TransportRequestCreateTest extends BasePiperTest {
assert loggingRule.log.contains("[INFO] Transport Request '001' has been successfully created.")
}
@Test
public void createTransportRequestSuccessRFCTest() {
def result = [:]
ChangeManagement cm = new ChangeManagement(nullScript) {
String createTransportRequestRFC(
Map docker,
String endpoint,
String developmentClient,
String developmentInstance,
String credentialsId,
String description) {
result.docker = docker
result.endpoint = endpoint
result.developmentClient = developmentClient
result.developmentInstance= developmentInstance
result.credentialsId = credentialsId
result.description = description
return '001'
}
}
stepRule.step.transportRequestCreate(
script: nullScript,
changeManagement: [
type: 'RFC',
rfc: [
developmentInstance: '01',
developmentClient: '001',
],
endpoint: 'https://example.org/rfc',
],
developmentSystemId: '001',
description: '',
cmUtils: cm)
assert nullScript.commonPipelineEnvironment.getTransportRequestId() == '001'
assert result == [
docker: [
image: 'rfc',
options: [],
envVars: [:],
imagePull: true
],
endpoint: 'https://example.org/rfc',
developmentClient: '01',
developmentInstance: '001',
credentialsId: 'CM',
description: ''
]
assert loggingRule.log.contains("[INFO] Creating transport request.")
assert loggingRule.log.contains("[INFO] Transport Request '001' has been successfully created.")
}
@Test
public void cmIntegrationSwichtedOffTest() {

View File

@ -38,6 +38,7 @@ void call(parameters = [:]) {
ChangeManagement cm = parameters.cmUtils ?: new ChangeManagement(script)
ConfigurationHelper configHelper = ConfigurationHelper.newInstance(this)
.collectValidationFailures()
.loadStepDefaults()
.mixinGeneralConfig(script.commonPipelineEnvironment, GENERAL_CONFIG_KEYS)
.mixinStepConfig(script.commonPipelineEnvironment, STEP_CONFIG_KEYS)
@ -90,7 +91,8 @@ void call(parameters = [:]) {
creatingMessage << '.'
echo creatingMessage.join()
try {
try {
if(backendType == BackendType.SOLMAN) {
transportRequestId = cm.createTransportRequestSOLMAN(
configuration.changeDocumentId,
@ -111,7 +113,7 @@ void call(parameters = [:]) {
configuration.changeManagement.rfc.docker,
configuration.changeManagement.endpoint,
configuration.changeManagement.rfc.developmentInstance,
configuration.changeManagement.rfc.developmenClient,
configuration.changeManagement.rfc.developmentClient,
configuration.changeManagement.credentialsId,
configuration.description)
} else {