I have a node which behaves like ‘CSV Writer’. It accepts an input table and writes out a csv file based on some logic.
Now, I have a method ‘writeCSV(BufferedDataTable inputTable)’. I need to write a junit test with a sample BufferedInputTable and test/validate the written csv file.
How can I create a BufferedDataTable in my junit test?
First of all, is this something that could be best tested with a junit test or test workflow?
If you need to create unit tests you might encounter situations where standard Junit tests will not work due to dependency issues, in those cases you can try running them as Junit plug-in tests.
BufferedDataTable are not designed to be created directly, they depend on an execution context and do not really work in isolation. For testing purposes look at other implementations of the DataTable interface, See the answer bellow Junit test for testing a Node's functionality - #6 by arofab
best,
Gabriel