{"action":"closed","issue":{"url":"https://api.github.com/repos/mulesoft/munit/issues/174","labels_url":"https://api.github.com/repos/mulesoft/munit/issues/174/labels{/name}","comments_url":"https://api.github.com/repos/mulesoft/munit/issues/174/comments","events_url":"https://api.github.com/repos/mulesoft/munit/issues/174/events","html_url":"https://github.com/mulesoft/munit/issues/174","id":63105221,"number":174,"title":"How to mock message inbound property","user":{"login":"cchilukoori","id":4825423,"avatar_url":"https://avatars.githubusercontent.com/u/4825423?v=3","gravatar_id":"","url":"https://api.github.com/users/cchilukoori","html_url":"https://github.com/cchilukoori","followers_url":"https://api.github.com/users/cchilukoori/followers","following_url":"https://api.github.com/users/cchilukoori/following{/other_user}","gists_url":"https://api.github.com/users/cchilukoori/gists{/gist_id}","starred_url":"https://api.github.com/users/cchilukoori/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cchilukoori/subscriptions","organizations_url":"https://api.github.com/users/cchilukoori/orgs","repos_url":"https://api.github.com/users/cchilukoori/repos","events_url":"https://api.github.com/users/cchilukoori/events{/privacy}","received_events_url":"https://api.github.com/users/cchilukoori/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-19T22:20:36Z","updated_at":"2015-03-20T19:24:29Z","closed_at":"2015-03-20T19:24:29Z","body":"Hi,\r\n\r\nHow can I mock message inbound property. Here is my flow:\r\n\r\n<flow name=\"_ingest_clearleap\" doc:name=\"Ingest Clearleap\" processingStrategy=\"synchronous\">\r\n        <file:inbound-endpoint path=\"${farallon.path.partner.watch.clearleap}\" moveToDirectory=\"${farallon.path.metadata.working}\" pollingFrequency=\"${farallon.rsc.watchFolderMonitorFrequency}\" fileAge=\"${farallon.rsc.minFileAge}\" responseTimeout=\"${farallon.rsc.responseTimeout}\" doc:name=\"XML Watch\">\r\n            <file:filename-regex-filter pattern=\".*\\.XML$\" caseSensitive=\"false\"/>\r\n        </file:inbound-endpoint>\r\n\t\t<file:file-to-string-transformer/>\r\n\t\t<set-variable variableName=\"partnerID\" value=\"132\" doc:name=\"Set Partner ID\" doc:description=\"REQUIRED. HARDCODED BASED ON partners TABLE ENTRY.\"/>\r\n        <set-variable variableName=\"xmlContent\" value=\"#[payload:]\"/> \r\n        \r\n\t\t<set-variable variableName=\"metadataFilename\" value=\"#[message.inboundProperties['originalFilename']]\" doc:name=\"Get Metadata Filename\" doc:description=\"REQUIRED. NO NEED TO CHANGE THIS. THIS ALWAYS HOLDS THE VALUE OF THE METADATA FILENAME.\"/>\r\n\t\t<logger message=\"PROCESS = INGEST, #[payload], FLOW = #[flow.name]\" level=\"INFO\" doc:name=\"Logger\"/>   \r\n\t\t<set-variable variableName=\"networkName\" value=\"#[XPATHEval://AMS[@Asset_Class='movie']/@Provider]\" doc:name=\"Get Network Name\" doc:description=\"REQUIRED. THIS VALUE EITHER NEEDS TO COME FROM THE XML OR BE HARDCODED TO A VALUE THAT MATCHES A DEFINED NETWORK NAME IN THE DB.\"/>\r\n\r\nI want to mock metadataFilename and return a value in the test case.\r\n\r\nHere is my test case:\r\n\r\n<munit:test name=\"testGoodXML\" description=\"Test good XML\">\r\n    \t<munit:set payload-ref=\"#[getResource('ClearLeap_Good.xml').asString()]\" doc:name=\"Set Message\"/>\r\n\r\n    \t<mock:when config-ref=\"mock_ingest_clearleap\" messageProcessor=\"flow\">\r\n            <mock:with-attributes>\r\n                <mock:with-attribute name=\"name\" whereValue-ref=\"#['GlobalIngestRouter']\"/>\r\n            </mock:with-attributes>\r\n        </mock:when>\r\n    \t\r\n    \t<flow-ref name=\"_ingest_clearleap\" doc:name=\"Flow Reference\"/>\r\n    \t\r\n    \t<mock:verify-call config-ref=\"mock_ingest_clearleap\" messageProcessor=\"flow\" times=\"1\">\r\n    \t\t<mock:attributes>\r\n                <mock:attribute name=\"name\" whereValue-ref=\"#['GlobalIngestRouter']\"/>\r\n            </mock:attributes>\r\n        </mock:verify-call>\r\n    \t\r\n    \t<munit:assert-on-equals message=\"SourceVideoFileName Assertion Failure\" expected-ref=\"#['XTRA_Musketeers_1_03_SD.mpg']\" value-ref=\"#[flowVars['sourceVideoFilename']]\"/>\r\n    \t<munit:assert-on-equals message=\"metaIdFromPartner Assertion Failure\" expected-ref=\"#['BBCA0002005410035001']\" value-ref=\"#[flowVars['metaIdFromPartner']]\"/>\r\n    \t<munit:assert-on-equals message=\"metaYear Assertion Failure\" expected-ref=\"#['2014']\" value-ref=\"#[flowVars['metaYear']]\"/> \r\n\t\t<munit:assert-on-equals message=\"ingestPath Assertion Failure\" expected-ref=\"#['/mnt/farallon/_partners/_iptv/']\" value-ref=\"#[flowVars['ingestPath']]\"/>\r\n\t\t<munit:assert-on-equals message=\"metadata file name Assertion Failure\" expected-ref=\"#['ClearLeap_Good.xml']\" value-ref=\"#[flowVars['metadataFilename']]\"/>\r\n    \t\r\n\t\t\r\n    </munit:test>\t"}}