Menu options

The Write Tests menu option can be used throughout IntelliJ:

The Write Tests menu option will create tests for your methods and classes but each menu option works slightly differently to produce tests for different parts of your code.

Project Tool Window

When navigating through your project, you'll likely use the project tool window in IntelliJ. Right-click on any of the elements and select Write Tests. Diffblue Cover will attempt to write tests for everything it can find within that package (license limitations may apply).

You can also select multiple classes with Shift or CTRL (CMD on MacOS). Cover will attempt to write tests for every class within your selection.

Structure Tool Window

Similar to the Project Tool Window, IntelliJ provides a Structure menu to help you navigate around your codebase. In particular, the structure menu will show classes, methods and other elements in the currently open file. As with the Project Tool Window, right-click on any method in the Structure Tool Window and select Write Tests, and you can also select multiple methods with Shift or CTRL (CMD on MacOS).

Text Editor

In the IntelliJ editor panel, you can right-click a method or class to display the Write Tests menu option - an alternative to the gutter icon, but also allows you to right-click anywhere within a class or method.

The menu option is also available when making one or more editor selections.

Diffblue Menu Bar

The Write Tests menu option is also available from the Diffblue menu bar. This will perform the exact same function as the menu option in the text editor.

Last updated