1. Tests Prerequisites
This page discusses the steps to configure a plugin project for creating tests.
Create a Folder for Tests
Open the plugin project and create a separate folder named test under the src directory. Under test, create the java folder for test source code, and the folder testData for test data files and reimport the Gradle project.
Set the Run Configuration Parameters
Because some of the tests use Java files as test data, the tests need to mock up the project's SDK. The testing framework uses java/mockJDK-$JAVA_VERSION$ from IntelliJ Community sources by default when using
LightJavaCodeInsightFixtureTestCase test base class.
The system properties are defined in the build.gradle file using the snippet shown below. The /path/to/intellij-community/ is set to the absolute path to the local IntelliJ Community project source's root directory on the machine running the tests. For example, on macOS it might be /Users/$USER_NAME$/Documents/intellij-community/