I am implementing MUnit for a flow where I need to send the payload through a Set Message Processor as a CopyOnWriteArrayList. The payload data would be fetched from a file.
The file would have comma separated XML Data. I need this data to be sent as CopyOnWriteArrayList.
Please help me on the Java class that can be used in MEL.
Please find below updated details :
For the MUnit test, I have the data in a file as of the format [First_XML_Data,Second_XML_Data]. The First_XML_Data and Second_XML_Data are both XML data. So basically first component in mule flow is Java transformer as below:
public class XMLData extends AbstractTransformer {
@Override
protected Object doTransform(Object src, String enc) throws TransformerException {
CopyOnWriteArrayList<String> list = (CopyOnWriteArrayList<String>) src;
}
}
As you can see, I need to prepare a payload in Set Message Processor so that it can be passed on to this Java transformer. So as of now I have the following MEL in set message processor of MUnit test,
[Arrays.asList((getResource('src/main/resources/xml_data.xml').asString().split(',')))]
The applications throws a type cast exception. So i need to some how send the payload as CopyOnWriteArrayList. As the data is too large , I am picking it up from the File
Thanks.