Appendix 1Setting Up JUnit in IntelliJ IDEA and NetBeans

In this appendix you’ll learn how to get JUnit unit tests running in both NetBeans and IntelliJ IDEA. The screenshots and IDE configuration steps you’ll see here supplant those in the Eclipse-based setup instructions starting at Learning JUnit Basics: Our First Passing Test. Note that these instructions cover configuring JUnit from scratch in the IDE and do not presume use of Maven or any other configuration tool.

For either IDE, first set up a Java project as you normally would. Then add the following source.[41] Make sure the package and directories match—both source files should end up in the iloveyouboss package within a source directory named src/iloveyouboss.

iloveyouboss/1/src/iloveyouboss/Scoreable.java ...

Get Pragmatic Unit Testing in Java 8 with JUnit now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.