This test ShowGraphServletTest uses the JFreeChart library which by default uses a Graphical UI to operate.
The test started failing when Bamboo had a DISPLAY environment variable set for Selenium tests.
The workaround for now is to have Selenium set the DISPLAY it needs at runtime and not have the variable be global for all Bamboo jobs.
But, for the sake of making this headless the fix can be to set the surefire plugin to use the headless JVM property.
In in the pom.xml, use
Steps to reproduce.
1. Set DISPLAY=:99 #This variable needs to be accessible to the user running Bamboo (e.qbamboo)
2. Run Junit tests for core. # specifically the test mentioned above.
3. The result of the test will contain this error message.
"Can't connect to X11 window server using ':99' as the value of the DISPLAY variable."
See https://ci-stg.openmrs.org/browse/TRUNK-LATEST-JOB1-56/test/case/2362046 for full error.