Hi, I have a spark job that reads an XML file from HDFS, process it and port data to Hive tables, one good and one exception table
The Code itself works fine. I need to create Unit Test with Mockito <https://www.vogella.com/tutorials/Mockito/article.html>for it.. A unit test should test functionality in isolation. Side effects from other classes or the system should be eliminated for a unit test, if possible. So basically there are three classes. 1. Class A, reads XML file and created a DF1 on it plus a DF2 on top of DF1. Test data for XML file is already created 2. Class B, reads DF2 and post correct data through TempView and Spark SQL to the underlying Hive table 3. Class C, read DF2 and post exception data again through TempView and Spark SQL to the underlying Hive exception table I would like to know for cases covering tests for Class B and Class C what Mockito format needs to be used.. Thanks, Mich *Disclaimer:* Use it at your own risk. Any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on this email's technical content is explicitly disclaimed. The author will in no case be liable for any monetary damages arising from such loss, damage or destruction.