Have a look at https://wiki.apache.org/hadoop/HowToDevelopUnitTests , which (now) explains the miniclusters​ -which you can use for testing against in-VM HDFS and YARN cluster simulations. Passing unit tests doesn't mean your code works in a real cluster, but failing them does mean that it won't -and they are great for both local and Jenkins-managed builds
-- CONFIDENTIALITY NOTICE NOTICE: This message is intended for the use of the individual or entity to which it is addressed and may contain information that is confidential, privileged and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any printing, copying, dissemination, distribution, disclosure or forwarding of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and delete it from your system. Thank You.