NetBeans 8.1 comes with a new JUnit, which no longer bundles Hamcrest, which is required for JUnit to work. So you have to add Hamcrest library to the project. The text that currently describes this situation in the "Resolve Project Problems" dialog is "JUnit 4.12 does not bundle hamcrest matchers library. Click the resolve button to automatically add hamcrest as your project's test dependency."
This text should be updated to more fully describe the situation.