Correct way to mock sftp-list operation where attributes can be available inside foreach loop:
\<flow doc:name="Flow" \>
\<file:list doc:name="List" config-ref="File_Config" directoryPath="/tmp/"/\>
\</flow\>
\<munit-tools:mock-when processor="file:list"\>
\<munit-tools:with-attributes\>
\<munit-tools:with-attribute attributeName="doc:name" whereValue="List"/\>
\</munit-tools:with-attributes\>
\<munit-tools:then-return\>
\<munit-tools:payload value="#\[\[MunitTools::createMessage( "ITEM-1", "text/plain", { property : 'ATTRIBUTE-1'}, null) , MunitTools::createMessage( "ITEM-2", "text/plain", { property : 'ATTRIBUTE-2'}, null)\]\]" /\>
\</munit-tools:then-return\>
\</munit-tools:mock-when\>