JUnit Tests fail to load Application Context with Patient Flags Module

Module: Patient Flags Module

Module Version: 1.3.5

System Version: OpenMRS 2.0

Issue or Question: JUnit Tests fail to load application Context. I’ve looked previous posts on this, I don’t seem to find any helpful information. This error had existed with the Patient Flags module itself. I don’t know if there’s something wrong in the POM. But I can’t get past this error. Here is the Error Log.

Current state of the omod POM


In your pom file try adding a dependency to the OpenMRS API since that is where the BaseModuleActivator class is found


As @ssmusoke says, you need the correct classes on the classpath to avoid errors like:

Caused by: java.io.FileNotFoundException: class path resource [org/openmrs/module/BaseModuleActivator.class] cannot be opened because it does not exist
1 Like

Alright, I see. Let me do that now.


I added this to the POM file, it generated these errors https://gist.github.com/Ch3ck/351aa7a7af105fa9de608b139346b99a. Let me try to investigate these errors further.

Your openMRSVersion references 1.6.5 which does not have that class. You need to use version 1.7.3 and above.

Thanks @dkayiwa that worked! :slight_smile: