Running JUnit Tests with a Headless Browser in Selenium

I have successfully recorded Selenium scripts using the IDE and transformed them into JUnit 4 WebDriver scripts. However, I needed to modify these scripts to ensure they operate correctly as JUnit tests. My next step is to execute these tests in a continuous integration environment, which requires a headless browser. While I’ve come across various discussions, my focus is specifically on JUnit compatibility. What would be the most effective solution for running these scripts with a headless browser? Any guidance would be greatly appreciated.