1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-06 04:13:55 +02:00

Refactor all instances of iFlow to be integrationFlow (#2992)

This commit is contained in:
Linda Siebert 2021-08-04 16:42:25 +02:00 committed by GitHub
parent bb3f8493ee
commit f9e052e4d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 70 additions and 70 deletions

View File

@ -111,7 +111,7 @@ func runIntegrationArtifactGetMplStatus(
} }
if jsonResponse.Exists("d", "results", "0") { if jsonResponse.Exists("d", "results", "0") {
mplStatus := jsonResponse.Path("d.results.0.Status").Data().(string) mplStatus := jsonResponse.Path("d.results.0.Status").Data().(string)
commonPipelineEnvironment.custom.iFlowMplStatus = mplStatus commonPipelineEnvironment.custom.integrationFlowMplStatus = mplStatus
//if error, then return immediately with the error details //if error, then return immediately with the error details
if mplStatus == "FAILED" { if mplStatus == "FAILED" {
@ -160,7 +160,7 @@ func getIntegrationArtifactMPLError(commonPipelineEnvironment *integrationArtifa
return "", errors.Wrapf(readErr, "HTTP response body could not be read, response status code: %v", errorStatusResp.StatusCode) return "", errors.Wrapf(readErr, "HTTP response body could not be read, response status code: %v", errorStatusResp.StatusCode)
} }
mplErrorDetails := string(responseBody) mplErrorDetails := string(responseBody)
commonPipelineEnvironment.custom.iFlowMplError = mplErrorDetails commonPipelineEnvironment.custom.integrationFlowMplError = mplErrorDetails
return mplErrorDetails, nil return mplErrorDetails, nil
} }
if httpErr != nil { if httpErr != nil {

View File

@ -23,8 +23,8 @@ type integrationArtifactGetMplStatusOptions struct {
type integrationArtifactGetMplStatusCommonPipelineEnvironment struct { type integrationArtifactGetMplStatusCommonPipelineEnvironment struct {
custom struct { custom struct {
iFlowMplStatus string integrationFlowMplStatus string
iFlowMplError string integrationFlowMplError string
} }
} }
@ -34,8 +34,8 @@ func (p *integrationArtifactGetMplStatusCommonPipelineEnvironment) persist(path,
name string name string
value interface{} value interface{}
}{ }{
{category: "custom", name: "iFlowMplStatus", value: p.custom.iFlowMplStatus}, {category: "custom", name: "integrationFlowMplStatus", value: p.custom.integrationFlowMplStatus},
{category: "custom", name: "iFlowMplError", value: p.custom.iFlowMplError}, {category: "custom", name: "integrationFlowMplError", value: p.custom.integrationFlowMplError},
} }
errCount := 0 errCount := 0
@ -182,8 +182,8 @@ func integrationArtifactGetMplStatusMetadata() config.StepData {
Name: "commonPipelineEnvironment", Name: "commonPipelineEnvironment",
Type: "piperEnvironment", Type: "piperEnvironment",
Parameters: []map[string]interface{}{ Parameters: []map[string]interface{}{
{"Name": "custom/iFlowMplStatus"}, {"Name": "custom/integrationFlowMplStatus"},
{"Name": "custom/iFlowMplError"}, {"Name": "custom/integrationFlowMplError"},
}, },
}, },
}, },

View File

@ -44,7 +44,7 @@ func TestRunIntegrationArtifactGetMplStatus(t *testing.T) {
err := runIntegrationArtifactGetMplStatus(&config, nil, &httpClient, &seOut) err := runIntegrationArtifactGetMplStatus(&config, nil, &httpClient, &seOut)
if assert.NoError(t, err) { if assert.NoError(t, err) {
assert.EqualValues(t, seOut.custom.iFlowMplStatus, "COMPLETED") assert.EqualValues(t, seOut.custom.integrationFlowMplStatus, "COMPLETED")
t.Run("check url", func(t *testing.T) { t.Run("check url", func(t *testing.T) {
assert.Equal(t, "https://demo/api/v1/MessageProcessingLogs?$filter=IntegrationArtifact/Id+eq+'flow1'+and+Status+ne+'DISCARDED'&$orderby=LogEnd+desc&$top=1", httpClient.URL) assert.Equal(t, "https://demo/api/v1/MessageProcessingLogs?$filter=IntegrationArtifact/Id+eq+'flow1'+and+Status+ne+'DISCARDED'&$orderby=LogEnd+desc&$top=1", httpClient.URL)
@ -75,7 +75,7 @@ func TestRunIntegrationArtifactGetMplStatus(t *testing.T) {
seOut := integrationArtifactGetMplStatusCommonPipelineEnvironment{} seOut := integrationArtifactGetMplStatusCommonPipelineEnvironment{}
err := runIntegrationArtifactGetMplStatus(&config, nil, &httpClient, &seOut) err := runIntegrationArtifactGetMplStatus(&config, nil, &httpClient, &seOut)
assert.EqualValues(t, seOut.custom.iFlowMplStatus, "") assert.EqualValues(t, seOut.custom.integrationFlowMplStatus, "")
assert.EqualError(t, err, "HTTP GET request to https://demo/api/v1/MessageProcessingLogs?$filter=IntegrationArtifact/"+ assert.EqualError(t, err, "HTTP GET request to https://demo/api/v1/MessageProcessingLogs?$filter=IntegrationArtifact/"+
"Id+eq+'flow1'+and+Status+ne+'DISCARDED'&$orderby=LogEnd+desc&$top=1 failed with error: "+ "Id+eq+'flow1'+and+Status+ne+'DISCARDED'&$orderby=LogEnd+desc&$top=1 failed with error: "+
"Unable to get integration flow MPL status, Response Status code:400") "Unable to get integration flow MPL status, Response Status code:400")
@ -89,7 +89,7 @@ func TestRunIntegrationArtifactGetMplStatus(t *testing.T) {
message, err := getIntegrationArtifactMPLError(&seOut, "1000111", &httpClient, "demo") message, err := getIntegrationArtifactMPLError(&seOut, "1000111", &httpClient, "demo")
assert.NoError(t, err) assert.NoError(t, err)
assert.NotNil(t, message) assert.NotNil(t, message)
assert.EqualValues(t, seOut.custom.iFlowMplError, "{\"message\": \"java.lang.IllegalStateException: No credentials for 'smtp' found\"}") assert.EqualValues(t, seOut.custom.integrationFlowMplError, "{\"message\": \"java.lang.IllegalStateException: No credentials for 'smtp' found\"}")
}) })
} }

View File

@ -106,7 +106,7 @@ func runIntegrationArtifactGetServiceEndpoint(config *integrationArtifactGetServ
if iflowID == config.IntegrationFlowID { if iflowID == config.IntegrationFlowID {
entryPoints := child.S("EntryPoints") entryPoints := child.S("EntryPoints")
finalEndpoint := entryPoints.Path("results.0.Url").Data().(string) finalEndpoint := entryPoints.Path("results.0.Url").Data().(string)
commonPipelineEnvironment.custom.iFlowServiceEndpoint = finalEndpoint commonPipelineEnvironment.custom.integrationFlowServiceEndpoint = finalEndpoint
return nil return nil
} }
} }

View File

@ -23,7 +23,7 @@ type integrationArtifactGetServiceEndpointOptions struct {
type integrationArtifactGetServiceEndpointCommonPipelineEnvironment struct { type integrationArtifactGetServiceEndpointCommonPipelineEnvironment struct {
custom struct { custom struct {
iFlowServiceEndpoint string integrationFlowServiceEndpoint string
} }
} }
@ -33,7 +33,7 @@ func (p *integrationArtifactGetServiceEndpointCommonPipelineEnvironment) persist
name string name string
value interface{} value interface{}
}{ }{
{category: "custom", name: "iFlowServiceEndpoint", value: p.custom.iFlowServiceEndpoint}, {category: "custom", name: "integrationFlowServiceEndpoint", value: p.custom.integrationFlowServiceEndpoint},
} }
errCount := 0 errCount := 0
@ -180,7 +180,7 @@ func integrationArtifactGetServiceEndpointMetadata() config.StepData {
Name: "commonPipelineEnvironment", Name: "commonPipelineEnvironment",
Type: "piperEnvironment", Type: "piperEnvironment",
Parameters: []map[string]interface{}{ Parameters: []map[string]interface{}{
{"Name": "custom/iFlowServiceEndpoint"}, {"Name": "custom/integrationFlowServiceEndpoint"},
}, },
}, },
}, },

View File

@ -40,7 +40,7 @@ func TestRunIntegrationArtifactGetServiceEndpoint(t *testing.T) {
httpClient := httpMockCpis{CPIFunction: "IntegrationArtifactGetServiceEndpoint", ResponseBody: ``, TestType: "PositiveAndGetetIntegrationArtifactGetServiceResBody"} httpClient := httpMockCpis{CPIFunction: "IntegrationArtifactGetServiceEndpoint", ResponseBody: ``, TestType: "PositiveAndGetetIntegrationArtifactGetServiceResBody"}
seOut := integrationArtifactGetServiceEndpointCommonPipelineEnvironment{} seOut := integrationArtifactGetServiceEndpointCommonPipelineEnvironment{}
err := runIntegrationArtifactGetServiceEndpoint(&config, nil, &httpClient, &seOut) err := runIntegrationArtifactGetServiceEndpoint(&config, nil, &httpClient, &seOut)
assert.EqualValues(t, seOut.custom.iFlowServiceEndpoint, "https://demo.cfapps.sap.hana.ondemand.com/http/testwithcert") assert.EqualValues(t, seOut.custom.integrationFlowServiceEndpoint, "https://demo.cfapps.sap.hana.ondemand.com/http/testwithcert")
if assert.NoError(t, err) { if assert.NoError(t, err) {
@ -73,7 +73,7 @@ func TestRunIntegrationArtifactGetServiceEndpoint(t *testing.T) {
seOut := integrationArtifactGetServiceEndpointCommonPipelineEnvironment{} seOut := integrationArtifactGetServiceEndpointCommonPipelineEnvironment{}
err := runIntegrationArtifactGetServiceEndpoint(&config, nil, &httpClient, &seOut) err := runIntegrationArtifactGetServiceEndpoint(&config, nil, &httpClient, &seOut)
assert.EqualValues(t, seOut.custom.iFlowServiceEndpoint, "") assert.EqualValues(t, seOut.custom.integrationFlowServiceEndpoint, "")
assert.EqualError(t, err, "HTTP GET request to https://demo/api/v1/ServiceEndpoints?$expand=EntryPoints failed with error: Unable to get integration flow service endpoint, Response Status code:400") assert.EqualError(t, err, "HTTP GET request to https://demo/api/v1/ServiceEndpoints?$expand=EntryPoints failed with error: Unable to get integration flow service endpoint, Response Status code:400")
}) })

View File

@ -67,10 +67,10 @@ func integrationArtifactTriggerIntegrationTest(config integrationArtifactTrigger
func runIntegrationArtifactTriggerIntegrationTest(config *integrationArtifactTriggerIntegrationTestOptions, telemetryData *telemetry.CustomData, utils integrationArtifactTriggerIntegrationTestUtils, httpClient piperhttp.Sender) error { func runIntegrationArtifactTriggerIntegrationTest(config *integrationArtifactTriggerIntegrationTestOptions, telemetryData *telemetry.CustomData, utils integrationArtifactTriggerIntegrationTestUtils, httpClient piperhttp.Sender) error {
var commonPipelineEnvironment integrationArtifactGetServiceEndpointCommonPipelineEnvironment var commonPipelineEnvironment integrationArtifactGetServiceEndpointCommonPipelineEnvironment
var serviceEndpointUrl string var serviceEndpointUrl string
if len(config.IFlowServiceEndpointURL) > 0 { if len(config.IntegrationFlowServiceEndpointURL) > 0 {
serviceEndpointUrl = config.IFlowServiceEndpointURL serviceEndpointUrl = config.IntegrationFlowServiceEndpointURL
} else { } else {
serviceEndpointUrl = commonPipelineEnvironment.custom.iFlowServiceEndpoint serviceEndpointUrl = commonPipelineEnvironment.custom.integrationFlowServiceEndpoint
if len(serviceEndpointUrl) == 0 { if len(serviceEndpointUrl) == 0 {
log.SetErrorCategory(log.ErrorConfiguration) log.SetErrorCategory(log.ErrorConfiguration)
return fmt.Errorf("IFlowServiceEndpointURL not set") return fmt.Errorf("IFlowServiceEndpointURL not set")
@ -122,7 +122,7 @@ func callIFlowURL(config *integrationArtifactTriggerIntegrationTestOptions, tele
httpMethod = "GET" httpMethod = "GET"
} }
serviceKey, err := cpi.ReadCpiServiceKey(config.IFlowServiceKey) serviceKey, err := cpi.ReadCpiServiceKey(config.IntegrationFlowServiceKey)
if err != nil { if err != nil {
return err return err
} }

View File

@ -15,11 +15,11 @@ import (
) )
type integrationArtifactTriggerIntegrationTestOptions struct { type integrationArtifactTriggerIntegrationTestOptions struct {
IFlowServiceKey string `json:"iFlowServiceKey,omitempty"` IntegrationFlowServiceKey string `json:"integrationFlowServiceKey,omitempty"`
IntegrationFlowID string `json:"integrationFlowId,omitempty"` IntegrationFlowID string `json:"integrationFlowId,omitempty"`
IFlowServiceEndpointURL string `json:"iFlowServiceEndpointUrl,omitempty"` IntegrationFlowServiceEndpointURL string `json:"integrationFlowServiceEndpointUrl,omitempty"`
ContentType string `json:"contentType,omitempty"` ContentType string `json:"contentType,omitempty"`
MessageBodyPath string `json:"messageBodyPath,omitempty"` MessageBodyPath string `json:"messageBodyPath,omitempty"`
} }
// IntegrationArtifactTriggerIntegrationTestCommand Test the service endpoint of your iFlow // IntegrationArtifactTriggerIntegrationTestCommand Test the service endpoint of your iFlow
@ -51,7 +51,7 @@ func IntegrationArtifactTriggerIntegrationTestCommand() *cobra.Command {
log.SetErrorCategory(log.ErrorConfiguration) log.SetErrorCategory(log.ErrorConfiguration)
return err return err
} }
log.RegisterSecret(stepConfig.IFlowServiceKey) log.RegisterSecret(stepConfig.IntegrationFlowServiceKey)
if len(GeneralConfig.HookConfig.SentryConfig.Dsn) > 0 { if len(GeneralConfig.HookConfig.SentryConfig.Dsn) > 0 {
sentryHook := log.NewSentryHook(GeneralConfig.HookConfig.SentryConfig.Dsn, GeneralConfig.CorrelationID) sentryHook := log.NewSentryHook(GeneralConfig.HookConfig.SentryConfig.Dsn, GeneralConfig.CorrelationID)
@ -98,15 +98,15 @@ func IntegrationArtifactTriggerIntegrationTestCommand() *cobra.Command {
} }
func addIntegrationArtifactTriggerIntegrationTestFlags(cmd *cobra.Command, stepConfig *integrationArtifactTriggerIntegrationTestOptions) { func addIntegrationArtifactTriggerIntegrationTestFlags(cmd *cobra.Command, stepConfig *integrationArtifactTriggerIntegrationTestOptions) {
cmd.Flags().StringVar(&stepConfig.IFlowServiceKey, "iFlowServiceKey", os.Getenv("PIPER_iFlowServiceKey"), "Service key JSON string to access the Process Integration Runtime service instance of plan 'integration-flow'") cmd.Flags().StringVar(&stepConfig.IntegrationFlowServiceKey, "integrationFlowServiceKey", os.Getenv("PIPER_integrationFlowServiceKey"), "Service key JSON string to access the Process Integration Runtime service instance of plan 'integration-flow'")
cmd.Flags().StringVar(&stepConfig.IntegrationFlowID, "integrationFlowId", os.Getenv("PIPER_integrationFlowId"), "Specifies the ID of the Integration Flow artifact") cmd.Flags().StringVar(&stepConfig.IntegrationFlowID, "integrationFlowId", os.Getenv("PIPER_integrationFlowId"), "Specifies the ID of the Integration Flow artifact")
cmd.Flags().StringVar(&stepConfig.IFlowServiceEndpointURL, "iFlowServiceEndpointUrl", os.Getenv("PIPER_iFlowServiceEndpointUrl"), "Specifies the URL endpoint of the iFlow. Please provide in the format `<protocol>://<host>:<port>`. Supported protocols are `http` and `https`.") cmd.Flags().StringVar(&stepConfig.IntegrationFlowServiceEndpointURL, "integrationFlowServiceEndpointUrl", os.Getenv("PIPER_integrationFlowServiceEndpointUrl"), "Specifies the URL endpoint of the iFlow. Please provide in the format `<protocol>://<host>:<port>`. Supported protocols are `http` and `https`.")
cmd.Flags().StringVar(&stepConfig.ContentType, "contentType", os.Getenv("PIPER_contentType"), "Specifies the content type of the file defined in messageBodyPath e.g. application/json") cmd.Flags().StringVar(&stepConfig.ContentType, "contentType", os.Getenv("PIPER_contentType"), "Specifies the content type of the file defined in messageBodyPath e.g. application/json")
cmd.Flags().StringVar(&stepConfig.MessageBodyPath, "messageBodyPath", os.Getenv("PIPER_messageBodyPath"), "Speficfies the relative file path to the message body.") cmd.Flags().StringVar(&stepConfig.MessageBodyPath, "messageBodyPath", os.Getenv("PIPER_messageBodyPath"), "Speficfies the relative file path to the message body.")
cmd.MarkFlagRequired("iFlowServiceKey") cmd.MarkFlagRequired("integrationFlowServiceKey")
cmd.MarkFlagRequired("integrationFlowId") cmd.MarkFlagRequired("integrationFlowId")
cmd.MarkFlagRequired("iFlowServiceEndpointUrl") cmd.MarkFlagRequired("integrationFlowServiceEndpointUrl")
} }
// retrieve step metadata // retrieve step metadata
@ -120,15 +120,15 @@ func integrationArtifactTriggerIntegrationTestMetadata() config.StepData {
Spec: config.StepSpec{ Spec: config.StepSpec{
Inputs: config.StepInputs{ Inputs: config.StepInputs{
Secrets: []config.StepSecrets{ Secrets: []config.StepSecrets{
{Name: "iFlowServiceKeyCredentialsId", Description: "Jenkins secret text credential ID containing the service key to the Process Integration Runtime service instance of plan 'integration-flow'", Type: "jenkins"}, {Name: "integrationFlowServiceKeyCredentialsId", Description: "Jenkins secret text credential ID containing the service key to the Process Integration Runtime service instance of plan 'integration-flow'", Type: "jenkins"},
}, },
Parameters: []config.StepParameters{ Parameters: []config.StepParameters{
{ {
Name: "iFlowServiceKey", Name: "integrationFlowServiceKey",
ResourceRef: []config.ResourceReference{ ResourceRef: []config.ResourceReference{
{ {
Name: "iFlowServiceKeyCredentialsId", Name: "integrationFlowServiceKeyCredentialsId",
Param: "iFlowServiceKey", Param: "integrationFlowServiceKey",
Type: "secret", Type: "secret",
}, },
}, },
@ -136,7 +136,7 @@ func integrationArtifactTriggerIntegrationTestMetadata() config.StepData {
Type: "string", Type: "string",
Mandatory: true, Mandatory: true,
Aliases: []config.Alias{}, Aliases: []config.Alias{},
Default: os.Getenv("PIPER_iFlowServiceKey"), Default: os.Getenv("PIPER_integrationFlowServiceKey"),
}, },
{ {
Name: "integrationFlowId", Name: "integrationFlowId",
@ -148,18 +148,18 @@ func integrationArtifactTriggerIntegrationTestMetadata() config.StepData {
Default: os.Getenv("PIPER_integrationFlowId"), Default: os.Getenv("PIPER_integrationFlowId"),
}, },
{ {
Name: "iFlowServiceEndpointUrl", Name: "integrationFlowServiceEndpointUrl",
ResourceRef: []config.ResourceReference{ ResourceRef: []config.ResourceReference{
{ {
Name: "commonPipelineEnvironment", Name: "commonPipelineEnvironment",
Param: "custom/iFlowServiceEndpoint", Param: "custom/integrationFlowServiceEndpoint",
}, },
}, },
Scope: []string{"PARAMETERS"}, Scope: []string{"PARAMETERS"},
Type: "string", Type: "string",
Mandatory: true, Mandatory: true,
Aliases: []config.Alias{}, Aliases: []config.Alias{},
Default: os.Getenv("PIPER_iFlowServiceEndpointUrl"), Default: os.Getenv("PIPER_integrationFlowServiceEndpointUrl"),
}, },
{ {
Name: "contentType", Name: "contentType",

View File

@ -35,10 +35,10 @@ func TestRunIntegrationArtifactTriggerIntegrationTest(t *testing.T) {
} }
}` }`
config := integrationArtifactTriggerIntegrationTestOptions{ config := integrationArtifactTriggerIntegrationTestOptions{
IFlowServiceKey: iFlowServiceKey, IntegrationFlowServiceKey: iFlowServiceKey,
IntegrationFlowID: "CPI_IFlow_Call_using_Cert", IntegrationFlowID: "CPI_IFlow_Call_using_Cert",
MessageBodyPath: "/file.txt", MessageBodyPath: "/file.txt",
ContentType: "", ContentType: "",
} }
utils := newIntegrationArtifactTriggerIntegrationTestTestsUtils() utils := newIntegrationArtifactTriggerIntegrationTestTestsUtils()
@ -63,10 +63,10 @@ func TestRunIntegrationArtifactTriggerIntegrationTest(t *testing.T) {
} }
}` }`
config := integrationArtifactTriggerIntegrationTestOptions{ config := integrationArtifactTriggerIntegrationTestOptions{
IFlowServiceKey: iFlowServiceKey, IntegrationFlowServiceKey: iFlowServiceKey,
IntegrationFlowID: "CPI_IFlow_Call_using_Cert", IntegrationFlowID: "CPI_IFlow_Call_using_Cert",
MessageBodyPath: "test.txt", MessageBodyPath: "test.txt",
ContentType: "txt", ContentType: "txt",
} }
utils := newIntegrationArtifactTriggerIntegrationTestTestsUtils() utils := newIntegrationArtifactTriggerIntegrationTestTestsUtils()
@ -94,10 +94,10 @@ func TestRunIntegrationArtifactTriggerIntegrationTest(t *testing.T) {
} }
}` }`
config := integrationArtifactTriggerIntegrationTestOptions{ config := integrationArtifactTriggerIntegrationTestOptions{
IFlowServiceKey: iFlowServiceKey, IntegrationFlowServiceKey: iFlowServiceKey,
IntegrationFlowID: "CPI_IFlow_Call_using_Cert", IntegrationFlowID: "CPI_IFlow_Call_using_Cert",
MessageBodyPath: filepath.Join(dir, "test.txt"), MessageBodyPath: filepath.Join(dir, "test.txt"),
ContentType: "txt", ContentType: "txt",
} }
utils := newIntegrationArtifactTriggerIntegrationTestTestsUtils() utils := newIntegrationArtifactTriggerIntegrationTestTestsUtils()
@ -125,10 +125,10 @@ func TestRunIntegrationArtifactTriggerIntegrationTest(t *testing.T) {
} }
}` }`
config := integrationArtifactTriggerIntegrationTestOptions{ config := integrationArtifactTriggerIntegrationTestOptions{
IFlowServiceKey: iFlowServiceKey, IntegrationFlowServiceKey: iFlowServiceKey,
IntegrationFlowID: "CPI_IFlow_Call_using_Cert", IntegrationFlowID: "CPI_IFlow_Call_using_Cert",
MessageBodyPath: "", MessageBodyPath: "",
ContentType: "txt", ContentType: "txt",
} }
utils := newIntegrationArtifactTriggerIntegrationTestTestsUtils() utils := newIntegrationArtifactTriggerIntegrationTestTestsUtils()
@ -160,10 +160,10 @@ func TestRunIntegrationArtifactTriggerIntegrationTest(t *testing.T) {
} }
}` }`
config := integrationArtifactTriggerIntegrationTestOptions{ config := integrationArtifactTriggerIntegrationTestOptions{
IFlowServiceKey: iFlowServiceKey, IntegrationFlowServiceKey: iFlowServiceKey,
IntegrationFlowID: "CPI_IFlow_Call_using_Cert", IntegrationFlowID: "CPI_IFlow_Call_using_Cert",
MessageBodyPath: filepath.Join(dir, "test.txt"), MessageBodyPath: filepath.Join(dir, "test.txt"),
ContentType: "txt", ContentType: "txt",
} }
utils := newIntegrationArtifactTriggerIntegrationTestTestsUtils() utils := newIntegrationArtifactTriggerIntegrationTestTestsUtils()

View File

@ -22,7 +22,7 @@ Example for the use in a YAML configuration file (such as `.pipeline/config.yaml
steps: steps:
<...> <...>
integrationArtifactTriggerIntegrationTest: integrationArtifactTriggerIntegrationTest:
iFlowCredentialsId: 'MY_IFLOW_SERVICE_KEY' integrationFlowServiceKeyCredentialsId: 'MY_INTEGRATION_FLOW_SERVICE_KEY'
integrationFlowId: 'INTEGRATION_FLOW_ID' integrationFlowId: 'INTEGRATION_FLOW_ID'
contentType: 'text/plain' contentType: 'text/plain'
messageBodyPath: 'myIntegrationsTest/testBody' messageBodyPath: 'myIntegrationsTest/testBody'

View File

@ -36,5 +36,5 @@ spec:
- name: commonPipelineEnvironment - name: commonPipelineEnvironment
type: piperEnvironment type: piperEnvironment
params: params:
- name: custom/iFlowMplStatus - name: custom/integrationFlowMplStatus
- name: custom/iFlowMplError - name: custom/integrationFlowMplError

View File

@ -36,4 +36,4 @@ spec:
- name: commonPipelineEnvironment - name: commonPipelineEnvironment
type: piperEnvironment type: piperEnvironment
params: params:
- name: custom/iFlowServiceEndpoint - name: custom/integrationFlowServiceEndpoint

View File

@ -7,11 +7,11 @@ metadata:
spec: spec:
inputs: inputs:
secrets: secrets:
- name: iFlowServiceKeyCredentialsId - name: integrationFlowServiceKeyCredentialsId
description: Jenkins secret text credential ID containing the service key to the Process Integration Runtime service instance of plan 'integration-flow' description: Jenkins secret text credential ID containing the service key to the Process Integration Runtime service instance of plan 'integration-flow'
type: jenkins type: jenkins
params: params:
- name: iFlowServiceKey - name: integrationFlowServiceKey
type: string type: string
description: Service key JSON string to access the Process Integration Runtime service instance of plan 'integration-flow' description: Service key JSON string to access the Process Integration Runtime service instance of plan 'integration-flow'
scope: scope:
@ -19,9 +19,9 @@ spec:
mandatory: true mandatory: true
secret: true secret: true
resourceRef: resourceRef:
- name: iFlowServiceKeyCredentialsId - name: integrationFlowServiceKeyCredentialsId
type: secret type: secret
param: iFlowServiceKey param: integrationFlowServiceKey
- name: integrationFlowId - name: integrationFlowId
type: string type: string
description: Specifies the ID of the Integration Flow artifact description: Specifies the ID of the Integration Flow artifact
@ -31,10 +31,10 @@ spec:
- STEPS - STEPS
- GENERAL - GENERAL
mandatory: true mandatory: true
- name: iFlowServiceEndpointUrl - name: integrationFlowServiceEndpointUrl
resourceRef: resourceRef:
- name: commonPipelineEnvironment - name: commonPipelineEnvironment
param: custom/iFlowServiceEndpoint param: custom/integrationFlowServiceEndpoint
type: string type: string
description: Specifies the URL endpoint of the iFlow. Please provide in the format `<protocol>://<host>:<port>`. Supported protocols are `http` and `https`. description: Specifies the URL endpoint of the iFlow. Please provide in the format `<protocol>://<host>:<port>`. Supported protocols are `http` and `https`.
scope: scope:

View File

@ -5,7 +5,7 @@ import groovy.transform.Field
void call(Map parameters = [:]) { void call(Map parameters = [:]) {
List credentials = [ List credentials = [
[type: 'token', id: 'iFlowServiceKeyCredentialsId', env: ['PIPER_iFlowServiceKey']] [type: 'token', id: 'integrationFlowServiceKeyCredentialsId', env: ['PIPER_integrationFlowServiceKey']]
] ]
piperExecuteBin(parameters, STEP_NAME, METADATA_FILE, credentials) piperExecuteBin(parameters, STEP_NAME, METADATA_FILE, credentials)
} }