From 39633b201b2c13ac933c43f3f64132b576ae1ef0 Mon Sep 17 00:00:00 2001 From: Marcel Schork Date: Mon, 15 Apr 2024 11:29:24 +0200 Subject: [PATCH] fix: support metadata props spread over several lines (#73) --- src/lib/client/ManifestReader.ts | 22 +- .../.project | 18 + .../META-INF/MANIFEST.MF | 46 ++ .../metainfo.prop | 6 + ...tOffboardUserRecordWithExportIdRequest.jar | Bin 0 -> 4337 bytes ...GetOffboardUserRecordWithExportId_In.opmap | 1 + ...etOffboardUserRecordResponse_Mapping_2.xsl | 44 ++ ...erRecordWithExportIdResponse_Mapping_1.xsl | 11 + .../src/main/resources/parameters.prop | 6 + .../src/main/resources/parameters.propdef | 41 ++ ...dingGetOffboardUserRecordWithExportId.iflw | 526 ++++++++++++++++++ ...gGetOffboardUserRecordWithExportId_In.wsdl | 1 + ...FOffboardingGetOffboardUserRecord_Out.wsdl | 1 + src/test/integration/IntegrationFlow.test.ts | 100 ++-- 14 files changed, 769 insertions(+), 54 deletions(-) create mode 100644 src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/.project create mode 100644 src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/META-INF/MANIFEST.MF create mode 100644 src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/metainfo.prop create mode 100644 src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/mapping/HCMgetOffboardUserRecordRequest_to_ONBgetOffboardUserRecordWithExportIdRequest.jar create mode 100644 src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/mapping/SFSFOffboardingGetOffboardUserRecord_Out_to_SFSFOffboardingGetOffboardUserRecordWithExportId_In.opmap create mode 100644 src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/mapping/XSLT_GetOffboardUserRecordResponse_Mapping_2.xsl create mode 100644 src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/mapping/XSLT_GetOffboardUserRecordWithExportIdResponse_Mapping_1.xsl create mode 100644 src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/parameters.prop create mode 100644 src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/parameters.propdef create mode 100644 src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/scenarioflows/integrationflow/SFSFOffboardingGetOffboardUserRecordWithExportId.iflw create mode 100644 src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/wsdl/SFSFOffboardingGetOffboardUserRecordWithExportId_In.wsdl create mode 100644 src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/wsdl/SFSFOffboardingGetOffboardUserRecord_Out.wsdl diff --git a/src/lib/client/ManifestReader.ts b/src/lib/client/ManifestReader.ts index fa580f4..efbfe19 100644 --- a/src/lib/client/ManifestReader.ts +++ b/src/lib/client/ManifestReader.ts @@ -10,14 +10,20 @@ export default class ManifestReader { constructor(artifactDirectory: string) { log.info(`Reading manifest from ${artifactDirectory}...`); this.manifestEntries = new Map(); - fs.readFileSync(path.join(artifactDirectory, 'META-INF', 'MANIFEST.MF'), 'utf-8') - .split(/\r?\n/) - .forEach((line) => { - const [key, value] = line.split(':'); - if (key && value) { - this.manifestEntries.set(key.trim(), value.trim()); - } - }); + const lines = fs.readFileSync(path.join(artifactDirectory, 'META-INF', 'MANIFEST.MF'), 'utf-8').split(/\r?\n/); + + let lastLineKey = ''; + lines.forEach((line) => { + const [key, value] = line.split(':'); + if (key && value && key.match(/^[^\s]+$/)) { + const keyTrimmed = key.trim(); + this.manifestEntries.set(keyTrimmed, value.trim()); + lastLineKey = keyTrimmed; + } else if (lastLineKey) { + const lastValue = this.manifestEntries.get(lastLineKey); + this.manifestEntries.set(lastLineKey, `${lastValue}${key.trim()}`); + } + }); } get(key: string) { diff --git a/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/.project b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/.project new file mode 100644 index 0000000..8c2d36b --- /dev/null +++ b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/.project @@ -0,0 +1,18 @@ + + com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExportId.EBZ + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + com.sap.ide.ifl.project.support.project.nature + com.sap.ide.ifl.odop + + \ No newline at end of file diff --git a/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/META-INF/MANIFEST.MF b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/META-INF/MANIFEST.MF new file mode 100644 index 0000000..4c85f75 --- /dev/null +++ b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/META-INF/MANIFEST.MF @@ -0,0 +1,46 @@ +Manifest-Version: 1.0 +Bundle-Description: +Bundle-SymbolicName: com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffbo + ardUserRecordWithExpabcd; singleton:=true +Origin-Bundle-SymbolicName: com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingG + etOffboardUserRecordWithExpabcd +Bundle-ManifestVersion: 2 +Origin-Bundle-Version: 1.0.0 +Import-Package: com.sap.esb.application.services.cxf.interceptor,com.s + ap.esb.security,com.sap.it.op.agent.api,com.sap.it.op.agent.collector + .camel,com.sap.it.op.agent.collector.cxf,com.sap.it.op.agent.mpl,com. + sap.sod.utils.cxf.interceptors,com.sap.sod.utils.encoding.processors, + com.sap.sod.utils.idoc.soap,com.sap.sod.utils.soap,com.sap.sod.utils. + idoc.soap.processors,javax.jms,javax.jws,javax.wsdl,javax.xml.bind.an + notation,javax.xml.namespace,javax.xml.ws,org.apache.camel;version="2 + .8",org.apache.camel.builder;version="2.8",org.apache.camel.builder.x + ml;version="2.8",org.apache.camel.component.cxf,org.apache.camel.mode + l;version="2.8",org.apache.camel.processor;version="2.8",org.apache.c + amel.processor.aggregate;version="2.8",org.apache.camel.spring.spi;ve + rsion="2.8",org.apache.commons.logging,org.apache.cxf.binding,org.apa + che.cxf.binding.soap,org.apache.cxf.binding.soap.spring,org.apache.cx + f.bus,org.apache.cxf.bus.resource,org.apache.cxf.bus.spring,org.apach + e.cxf.buslifecycle,org.apache.cxf.catalog,org.apache.cxf.configuratio + n.jsse,org.apache.cxf.configuration.spring,org.apache.cxf.endpoint,or + g.apache.cxf.headers,org.apache.cxf.interceptor,org.apache.cxf.manage + ment.counters,org.apache.cxf.message,org.apache.cxf.phase,org.apache. + cxf.resource,org.apache.cxf.service.factory,org.apache.cxf.service.mo + del,org.apache.cxf.transport,org.apache.cxf.transport.common.gzip,org + .apache.cxf.transport.http,org.apache.cxf.transport.http.policy,org.a + pache.cxf.workqueue,org.apache.cxf.ws.rm.persistence,org.apache.cxf.w + sdl11,org.osgi.framework;version="1.6.0",org.osgi.service.blueprint;v + ersion="[1.0.0,2.0.0)",org.slf4j;version="1.6",org.springframework.be + ans.factory.config;version="3.0",com.sap.aii.ib.bom.flib.types,com.sa + p.aii.mapping.api,com.sap.aii.mappingtool.flib3,com.sap.aii.mappingto + ol.flib7,com.sap.aii.mappingtool.tf3,com.sap.aii.mappingtool.tf3.rt,c + om.sap.aii.mappingtool.tf7,com.sap.aii.mappingtool.tf7.rt,com.sap.aii + .mappingtool.tfapi,com.sap.esb.webservice.audit.log +Origin-Bundle-Name: Integration Flow +SAP-RuntimeProfile: +Bundle-Name: Integration Flow +Bundle-Version: 1.0.0 +SAP-NodeType: IFLMAP +Origin-ModifiedDate: 1696523944750 +Import-Service: com.sap.esb.webservice.audit.log.AuditLogger +SAP-BundleType: IntegrationFlow + diff --git a/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/metainfo.prop b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/metainfo.prop new file mode 100644 index 0000000..138a216 --- /dev/null +++ b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/metainfo.prop @@ -0,0 +1,6 @@ +#Store metainfo properties +#Thu Apr 11 09:27:31 UTC 2024 +description=This process is used to get employee data for an offboarded employee. +SAP-MarkedSAP2SAP=SAP_TO_SAP_INTEGRATION +source=SAPHCM +target=SAPSuccessFactors diff --git a/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/mapping/HCMgetOffboardUserRecordRequest_to_ONBgetOffboardUserRecordWithExportIdRequest.jar b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/mapping/HCMgetOffboardUserRecordRequest_to_ONBgetOffboardUserRecordWithExportIdRequest.jar new file mode 100644 index 0000000000000000000000000000000000000000..f7e800ac5c71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z_}u@z2S%Xb;YhE_6#Cf8n1X*+q^`DsoMrtoc;hXrU) zJ8R{KZOoi}Ps5ujiE-&42GXePe$ zZV)o7YglzddxOI@(2gtsA)mt1Uqxxi5OcP3FwQt#7Ti{2HIQvG7*y4nCD)m`n>KFWD%}n1OwzV`Yw-*+-xhg7 zv^g!adBPVch=X1F#xbPzL(X(Z;T796`wwl`zIAFJZp{``Y`ngIE9Hs^aAqG_Bj^tOg~VQ?xb%O5ADq8=RGmpCZrn)=C~Rv7_nYc34yOVwidv{FaO3>1TNH zCbHqI+%ln$R!Qw18vCUL61+Q3WKv_jie7TWN|jhDZhhPwrm2`!(%C5Yy;a8))&wKD zip-FSbKzeQwW_j?QnVsS?2V@$UspohdvwK4ICb*$@*Sm2=yTmkc`M_@ykoK74&7Cjp!){4!!*XM{^Z zh-V5jrWt>%HohD2^KrgXr#wb=!PCn0KOg5yL_olwqvo%?{d3g(cm0SFSFOffboardingGetOffboardUserRecord_Out_to_SFSFOffboardingGetOffboardUserRecordWithExportId_Insrc/main/resources/mappingrainas2015-07-07 07:31:30.4351436247090435rainasSFSFONBIntegrationhttp://sap.com/xi/SFIHCM03GetOffboardUserRecordWithExportIdSoapInhttp://ATS.online-onboarding.com/Client/HRDataServiceExHCMgetOffboardUserRecordRequest_to_ONBgetOffboardUserRecordWithExportIdRequestsrc/main/resources/mappingXSLT_GetOffboardUserRecordWithExportIdResponse_Mapping_1src/main/resources/mappingXSLT_GetOffboardUserRecordResponse_Mapping_2src/main/resources/mappingSFSFONBIntegrationhttp://sap.com/xi/SFIHCM03GetOffboardUserRecordWithExportIdSoapOuthttp://ATS.online-onboarding.com/Client/HRDataServiceExgetNewHireRecordResponsehttp://sap.com/xi/SFIHCM03getNewHireRecordRequesthttp://sap.com/xi/SFIHCM03SFSFOffboardingGetOffboardUserRecord_Outsrc/main/resources/wsdlSFSFOffboardingGetOffboardUserRecordWithExportId_Insrc/main/resources/wsdlOIJ1:1111111 \ No newline at end of file diff --git a/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/mapping/XSLT_GetOffboardUserRecordResponse_Mapping_2.xsl b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/mapping/XSLT_GetOffboardUserRecordResponse_Mapping_2.xsl new file mode 100644 index 0000000..ecaddb9 --- /dev/null +++ b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/mapping/XSLT_GetOffboardUserRecordResponse_Mapping_2.xsl @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/mapping/XSLT_GetOffboardUserRecordWithExportIdResponse_Mapping_1.xsl b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/mapping/XSLT_GetOffboardUserRecordWithExportIdResponse_Mapping_1.xsl new file mode 100644 index 0000000..d28c36b --- /dev/null +++ b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/mapping/XSLT_GetOffboardUserRecordWithExportIdResponse_Mapping_1.xsl @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/parameters.prop b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/parameters.prop new file mode 100644 index 0000000..2b0c6cf --- /dev/null +++ b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/parameters.prop @@ -0,0 +1,6 @@ +#Thu Apr 11 09:27:31 UTC 2024 +SenderAddress=/hcm2bizx/SFSFOffboardingGetOffboardUserRecordWithExportId +SAPHCM_enableBasicAuthentication_17=false +subject=DC\=sender,CN\=sender +Offboarding_EndPoint=https\:// +issuer=DC\=issuer,CN\=issuer diff --git a/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/parameters.propdef b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/parameters.propdef new file mode 100644 index 0000000..a9969f8 --- /dev/null +++ b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/parameters.propdef @@ -0,0 +1,41 @@ + + + Offboarding_EndPoint + xsd:string + false + + + + + + issuer + xsd:string + false + + + + + + subject + xsd:string + false + + + + + + SenderAddress + xsd:string + false + + + + + + SAPHCM_enableBasicAuthentication_17 + xsd:string + false + + + + \ No newline at end of file diff --git a/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/scenarioflows/integrationflow/SFSFOffboardingGetOffboardUserRecordWithExportId.iflw b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/scenarioflows/integrationflow/SFSFOffboardingGetOffboardUserRecordWithExportId.iflw new file mode 100644 index 0000000..78e39ec --- /dev/null +++ b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/scenarioflows/integrationflow/SFSFOffboardingGetOffboardUserRecordWithExportId.iflw @@ -0,0 +1,526 @@ + + + + IntegrationFlowVersion + 1.0 + + + + Participant_1 + + + Participant_2 + + + + + routeid + MyProject + + + errorStrategy + None + + + namespaceMapping + xmlns:p1=http://sap.com/xi/SFIHCM03 + + + returnExceptionToSender + + + + ServerTrace + + + + cmdVariantUri + ctype::IFlowVariant/cname::IFlowConfiguration + + + log + All events + + + allowedHeaderList + + + + + + + enableBasicAuthentication + {{SAPHCM_enableBasicAuthentication_17}} + + + subject0 + {{subject}} + + + issuer0 + {{issuer}} + + + ifl:type + EndpointSender + + + + + + + + + + ifl:type + EndpointRecevier + + + + + + + Name + SAP + + + Description + + + + ComponentType + SOAP + + + ComponentNS + sap + + + ComponentSWCVId + 1.0 + + + ComponentSWCVName + 1.0 + + + adapterVersion + + + + TransportProtocol + HTTP + + + TransportProtocolVersion + 1.0 + + + MessageProtocol + SOAP 1.x + + + MessageProtocolVersion + 1.2 + + + address + {{SenderAddress}} + + + soapWsdlURL + /wsdl/SFSFOffboardingGetOffboardUserRecord_Out.wsdl + + + soapServiceName + p1:SFSFOffboardingGetOffboardUserRecord_Out + + + soapWsdlPortName + p1:SFSFOffboardingGetOffboardUserRecord_Out + + + soapOptions + None + + + WSSecurity + None + + + WSSecurityType + VerifyMessage + + + SaveIncomingSignedMessage + 0 + + + CheckTimeStamp + 0 + + + SenderBasicSecurityProfileCompliant + 1 + + + PrivateKeyAliasResponseSigning + + + + PublicKeyAliasResponseEncryption + + + + InitiatorTokenIncludeStrategy + AlwaysToRecipient + + + X509TokenAssertion + WssX509V3Token10 + + + RecipientTokenIncludeStrategy + Never + + + AlgorithmSuiteAssertion + Basic128Rsa15 + + + system + SAPHCM + + + direction + Sender + + + cmdVariantUri + ctype::AdapterVariant/cname::sap:SOAP/tp::HTTP/mp::SOAP 1.x/direction::Sender + + + + + + + Name + SuccessFactors + + + Description + + + + ComponentType + SOAP + + + ComponentNS + sap + + + ComponentSWCVId + 1.0 + + + ComponentSWCVName + 1.0 + + + adapterVersion + + + + TransportProtocol + HTTP + + + TransportProtocolVersion + 1.0 + + + MessageProtocol + SOAP 1.x + + + MessageProtocolVersion + 1.2 + + + address + {{Offboarding_EndPoint}} + + + proxyType + default + + + soapWsdlURL + /wsdl/SFSFOffboardingGetOffboardUserRecordWithExportId_In.wsdl + + + soapServiceName + p1:SFSFOffboardingGetOffboardUserRecordWithExportId_In + + + soapWsdlPortName + p1:SFSFOffboardingGetOffboardUserRecordWithExportId_In + + + requestTimeout + 60000 + + + CompressMessage + 0 + + + allowChunking + 1 + + + enableAnonymous + 0 + + + enableBasicAuthentication + 0 + + + WSSecurity_outbound + None + + + UserNameTokenOption + None + + + UserNameTokenCredentialName + + + + WsdlUserNameTokenCredentialName + + + + WSSecurityType_outbound + SignMessage + + + SetTimeStamp + 0 + + + PrivateKeyAliasSigning_wsdl + + + + PublicKeyAliasEncryption_wsdl + + + + SenderBasicSecurityProfileCompliant_wsdl + 1 + + + SenderBasicSecurityProfileCompliant + 1 + + + PrivateKeyAliasSigning + + + + PublicKeyAliasEncryption + + + + InitiatorTokenIncludeStrategy_outbound + AlwaysToRecipient + + + X509TokenAssertion + WssX509V3Token10 + + + RecipientTokenIncludeStrategy + Never + + + recipientX509TokenAssertion + WssX509V3Token10 + + + Layout_outbound + Strict + + + AlgorithmSuiteAssertion + Basic128Rsa15 + + + operationName + p1:SFSFOffboardingGetOffboardUserRecordWithExportId_In + + + credentialName + + + + system + SuccessFactors + + + privateKeyAlias + + + + proxyHost + + + + direction + Receiver + + + cmdVariantUri + ctype::AdapterVariant/cname::sap:SOAP/tp::HTTP/mp::SOAP 1.x/direction::Receiver + + + proxyPort + + + + + + + + + cmdVariantUri + ctype::FlowElementVariant/cname::IntegrationProcess + + + + + + cmdVariantUri + ctype::FlowstepVariant/cname::MessageStartEvent + + + SequenceFlow_1 + + + + + + cmdVariantUri + ctype::FlowstepVariant/cname::MessageEndEvent + + + SequenceFlow_2 + + + + + + + activityType + Mapping + + + mappinguri + dir://opmap/src/main/resources/mapping/SFSFOffboardingGetOffboardUserRecord_Out_to_SFSFOffboardingGetOffboardUserRecordWithExportId_In.opmap + + + mappingname + SFSFOffboardingGetOffboardUserRecord_Out_to_SFSFOffboardingGetOffboardUserRecordWithExportId_In + + + mappingpath + src/main/resources/mapping/SFSFOffboardingGetOffboardUserRecord_Out_to_SFSFOffboardingGetOffboardUserRecordWithExportId_In + + + bundle-name + + + + cmdVariantUri + ctype::FlowstepVariant/cname::OperationMapping + + + SequenceFlow_1 + SequenceFlow_2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/wsdl/SFSFOffboardingGetOffboardUserRecordWithExportId_In.wsdl b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/wsdl/SFSFOffboardingGetOffboardUserRecordWithExportId_In.wsdl new file mode 100644 index 0000000..757a113 --- /dev/null +++ b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/wsdl/SFSFOffboardingGetOffboardUserRecordWithExportId_In.wsdl @@ -0,0 +1 @@ + diff --git a/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/wsdl/SFSFOffboardingGetOffboardUserRecord_Out.wsdl b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/wsdl/SFSFOffboardingGetOffboardUserRecord_Out.wsdl new file mode 100644 index 0000000..fc4052c --- /dev/null +++ b/src/test/Testpackage/com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ/src/main/resources/wsdl/SFSFOffboardingGetOffboardUserRecord_Out.wsdl @@ -0,0 +1 @@ +Get New Hire Record from Onboardingdaa92f0d73b611e485ea000033b6d7f2f5f9630c73b611e48b42a44e31727a00f5f9630d73b611e4cee4a44e31727a0020c8f98573b911e4c6b0000033b6d7f220a3855b73b911e4cf35a44e31727a0020a3855973b911e4acbea44e31727a0020a3855a73b911e4a9aaa44e31727a0020a3855c73b911e49bc6a44e31727a006ffe49bf708f11e4ad5d000033b6d7f3 diff --git a/src/test/integration/IntegrationFlow.test.ts b/src/test/integration/IntegrationFlow.test.ts index c5d31f6..aa9e3ea 100644 --- a/src/test/integration/IntegrationFlow.test.ts +++ b/src/test/integration/IntegrationFlow.test.ts @@ -10,14 +10,11 @@ import APIAction from '../../lib/client/APIAction.js'; let sciRestClient: SCIRestClient; let artiFactDirectory: string; let randomPackageId = uuidv4().replaceAll('-', ''); -let iFlowDirectory: string; - beforeAll(async () => { const setupResult = await setup(); sciRestClient = setupResult.sciRestClient; artiFactDirectory = setupResult.artiFactDirectory; randomPackageId = setupResult.randomPackageId; - iFlowDirectory = path.join(artiFactDirectory, 'Testpackage', 'IntegrationFlow'); }); afterAll(async () => { @@ -25,56 +22,67 @@ afterAll(async () => { }); describe('Integration flow', () => { - it('create an integration flow', async () => { - const integrationFlow = await sciRestClient.createArtifactFromDirectory(randomPackageId, iFlowDirectory); - expect(integrationFlow).toBeDefined(); - }); + for (const iFlowFolder of ['IntegrationFlow', 'com.sap.SFIHCM03.hcm2bizx.SFSFOffboardingGetOffboardUserRecordWithExpabcd.EBZ']) { + it('create an integration flow', async () => { + const integrationFlow = await sciRestClient.createArtifactFromDirectory( + randomPackageId, + path.join(artiFactDirectory, 'Testpackage', iFlowFolder), + ); + expect(integrationFlow).toBeDefined(); + }); - it('fetch an integration flow ', async () => { - const readStream = (await sciRestClient.getArtifact('IntegrationFlow', '1.0.0', 'IntegrationFlow')) as ReadStream; + it('fetch an integration flow ', async () => { + const iFlowId = sciRestClient.getArtifactMetadata(path.join(artiFactDirectory, 'TestPackage', iFlowFolder)).Id; + const readStream = (await sciRestClient.getArtifact(iFlowId, '1.0.0', 'IntegrationFlow')) as ReadStream; - const writer = fs.createWriteStream(path.join(artiFactDirectory, 'test.zip')); - const finishPromise = new Promise((resolve, reject) => { - writer.on('finish', resolve); - writer.on('error', reject); + const writer = fs.createWriteStream(path.join(artiFactDirectory, 'test.zip')); + const finishPromise = new Promise((resolve, reject) => { + writer.on('finish', resolve); + writer.on('error', reject); + }); + readStream.pipe(writer); + await finishPromise; + expect(fs.existsSync(path.join(artiFactDirectory, 'test.zip'))).toBe(true); }); - readStream.pipe(writer); - await finishPromise; - expect(fs.existsSync(path.join(artiFactDirectory, 'test.zip'))).toBe(true); - }); - it('update an integration flow', async () => { - const integrationFlow = await sciRestClient.updateArtifactFromDirectory(iFlowDirectory); - expect(integrationFlow).toBe(undefined); - }); + it('update an integration flow', async () => { + const integrationFlow = await sciRestClient.updateArtifactFromDirectory( + path.join(artiFactDirectory, 'Testpackage', iFlowFolder), + ); + expect(integrationFlow).toBe(undefined); + }); - it('upload a new version of an integration flow', async () => { - await replace({ - files: path.join(iFlowDirectory, 'META-INF', 'MANIFEST.MF'), - from: /1.0.0/g, - to: '2.0.0', + it('upload a new version of an integration flow', async () => { + await replace({ + files: path.join(path.join(artiFactDirectory, 'Testpackage', iFlowFolder), 'META-INF', 'MANIFEST.MF'), + from: /1.0.0/g, + to: '2.0.0', + }); + const integrationFlow = await sciRestClient.updateArtifactFromDirectory( + path.join(artiFactDirectory, 'Testpackage', iFlowFolder), + ); + expect(integrationFlow).toBe(undefined); }); - const integrationFlow = await sciRestClient.updateArtifactFromDirectory( - path.join(artiFactDirectory, 'Testpackage', 'IntegrationFlow') - ); - expect(integrationFlow).toBe(undefined); - }); - it('determine the artifact type', () => { - expect(sciRestClient.getArtifactType(iFlowDirectory)).toBe('IntegrationFlow'); - }); + it('determine the artifact type', () => { + expect(sciRestClient.getArtifactType(path.join(artiFactDirectory, 'Testpackage', iFlowFolder))).toBe('IntegrationFlow'); + }); - it('check the supported API actions', () => { - expect(sciRestClient.isActionSupported(APIAction.Create, iFlowDirectory)).toBe(true); - expect(sciRestClient.isActionSupported(APIAction.Update, iFlowDirectory)).toBe(true); - expect(sciRestClient.isActionSupported(APIAction.New_Version, iFlowDirectory)).toBe(true); - expect(sciRestClient.isActionSupported(APIAction.Delete, iFlowDirectory)).toBe(false); - }); + it('check the supported API actions', () => { + const iFlowDirectory = path.join(artiFactDirectory, 'Testpackage', iFlowFolder); + expect(sciRestClient.isActionSupported(APIAction.Create, iFlowDirectory)).toBe(true); + expect(sciRestClient.isActionSupported(APIAction.Update, iFlowDirectory)).toBe(true); + expect(sciRestClient.isActionSupported(APIAction.New_Version, iFlowDirectory)).toBe(true); + expect(sciRestClient.isActionSupported(APIAction.Delete, iFlowDirectory)).toBe(false); + }); - it('provides the metadata for the artifact in the given directory', () => { - expect(sciRestClient.getArtifactMetadata(iFlowDirectory).Id).toBe('IntegrationFlow'); - expect(sciRestClient.getArtifactMetadata(iFlowDirectory).Version).toBe('2.0.0'); - expect(sciRestClient.getArtifactMetadata(iFlowDirectory).Name).toBe('Integration Flow'); - expect(sciRestClient.getArtifactMetadata(iFlowDirectory).Type).toBe('IntegrationFlow'); - }); + it('provides the metadata for the artifact in the given directory', () => { + const iFlowDirectory = path.join(artiFactDirectory, 'Testpackage', iFlowFolder); + const iFlowId = sciRestClient.getArtifactMetadata(iFlowDirectory).Id; + expect(sciRestClient.getArtifactMetadata(iFlowDirectory).Id).toBe(iFlowId); + expect(sciRestClient.getArtifactMetadata(iFlowDirectory).Version).toBe('2.0.0'); + expect(sciRestClient.getArtifactMetadata(iFlowDirectory).Name).toBe('Integration Flow'); + expect(sciRestClient.getArtifactMetadata(iFlowDirectory).Type).toBe('IntegrationFlow'); + }); + } });