See https://wiki.openmrs.org/display/docs/Generate+Test+Case+Plugin for how to write unit tests in openmrs.
What IDE do you use? If intelliJ let me know so that i can email you the plugin's jar file.