Skip to content

Instantly share code, notes, and snippets.

View webster92's full-sized avatar

Max Webster webster92

View GitHub Profile
id,name,age,married,email
number,string,number,boolean,string
1,Max Mule,,false,
2,<empty_string>,23,true,test@email.com
<mock:when messageProcessor=".*:.*" doc:name="Mock - Select Users">
<mock:with-attributes>
<mock:with-attribute name="doc:name" whereValue="#['Select Users']"/>
</mock:with-attributes>
<mock:then-return payload="#[dw(&quot;readUrl('classpath://database_mock.dwl','application/dw').csvToJava('mocks/users.csv')&quot;)]" mimeType="application/java"/>
</mock:when>
id name age married email
number string number boolean string
1 Max Mule false
2 <empty_string> 23 true test@email.com
%dw 1.0
%output application/java
%function getCsvFile(csvFile)
readUrl("classPath://" ++ csvFile, "application/csv")
%function toType(value, type)
null when value == '' otherwise (
value as :number when type == 'number' otherwise