mirror of
https://github.com/SAP/jenkins-library.git
synced 2026-06-19 22:58:55 +02:00
release transport request for cts
This commit is contained in:
@@ -355,6 +355,7 @@ public class ChangeManagement implements Serializable {
|
||||
}
|
||||
|
||||
void releaseTransportRequestCTS(
|
||||
Map docker,
|
||||
String transportRequestId,
|
||||
String endpoint,
|
||||
String credentialsId,
|
||||
@@ -368,7 +369,7 @@ public class ChangeManagement implements Serializable {
|
||||
|
||||
int rc = executeWithCredentials(
|
||||
BackendType.CTS,
|
||||
[:],
|
||||
docker,
|
||||
endpoint,
|
||||
credentialsId,
|
||||
cmd,
|
||||
|
||||
@@ -127,6 +127,7 @@ public class TransportRequestReleaseTest extends BasePiperTest {
|
||||
ChangeManagement cm = new ChangeManagement(nullScript) {
|
||||
|
||||
void releaseTransportRequestCTS(
|
||||
Map docker,
|
||||
String transportRequestId,
|
||||
String endpoint,
|
||||
String credentialsId,
|
||||
@@ -230,12 +231,14 @@ public class TransportRequestReleaseTest extends BasePiperTest {
|
||||
|
||||
ChangeManagement cm = new ChangeManagement(nullScript) {
|
||||
void releaseTransportRequestCTS(
|
||||
Map docker,
|
||||
String transportRequestId,
|
||||
String endpoint,
|
||||
String credentialsId,
|
||||
String clientOpts = '') {
|
||||
|
||||
receivedParameters = [
|
||||
docker: docker,
|
||||
transportRequestId: transportRequestId,
|
||||
endpoint: endpoint,
|
||||
credentialsId: credentialsId,
|
||||
@@ -250,6 +253,12 @@ public class TransportRequestReleaseTest extends BasePiperTest {
|
||||
cmUtils: cm)
|
||||
|
||||
assert receivedParameters == [
|
||||
docker: [
|
||||
image:'ppiper/cm-client',
|
||||
options:[],
|
||||
envVars:[:],
|
||||
pullImage:true,
|
||||
],
|
||||
transportRequestId: '002',
|
||||
endpoint: 'https://example.org/cts',
|
||||
credentialsId: 'CM',
|
||||
|
||||
@@ -424,6 +424,10 @@ public void testGetCommandLineWithCMClientOpts() {
|
||||
script.setReturnValue(JenkinsShellCallRule.Type.REGEX, '-t CTS export-transport.*-tID 002', 0)
|
||||
|
||||
new ChangeManagement(nullScript).releaseTransportRequestCTS(
|
||||
[
|
||||
image: 'ppiper/cm-client',
|
||||
pullImage: true,
|
||||
],
|
||||
'002',
|
||||
'https://example.org',
|
||||
'me',
|
||||
@@ -431,6 +435,9 @@ public void testGetCommandLineWithCMClientOpts() {
|
||||
|
||||
// no assert required here, since the regex registered above to the script rule is an implicit check for
|
||||
// the command line.
|
||||
|
||||
assert dockerExecuteRule.getDockerParams().dockerImage == 'ppiper/cm-client'
|
||||
assert dockerExecuteRule.getDockerParams().dockerPullImage == true
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -111,6 +111,7 @@ void call(parameters = [:]) {
|
||||
case BackendType.CTS:
|
||||
|
||||
cm.releaseTransportRequestCTS(
|
||||
configuration.changeManagement.cts.docker,
|
||||
configuration.transportRequestId,
|
||||
configuration.changeManagement.endpoint,
|
||||
configuration.changeManagement.credentialsId,
|
||||
|
||||
Reference in New Issue
Block a user