In the Package Explorer view, right-click the file for which you want to create a JUnit test. In the context menu that opens, select "Create" β "Other ...". In the Select Wizard dialog box, select Java β JUnit β JUnit Test Case.
Then a dialog box opens. If you have a default Maven or Gradle project, you probably have to change the default source folder from the provided ${PROJECT_NAME}/src/main/java to ${PROJECT_NAME}/src/test/java . If you click Next, a dialog box allows you to check which methods automatically create stubs for.
Michael Patterson Dec 12 '09 at 18:48 2009-12-12 18:48
source share