In this section:
Unit Test Assistant can help you create parameterized test cases to test methods against different arguments. Test cases can be added with the Parameterized option available in the Unit Test Assistant view. This option allows you to add test templates for individual methods selected in the editor. The generated templates need to be manually modified and completed with parameterization data.
Test parametrization is supported for JUnit 4 and 5. UTA generates parameterized tests using the testing framework and parameterization type configured in Preferences (see Configuring Preferences). |
UTA allows you to create parameterized tests for private methods to achieve a higher code coverage rate.
By default, the Create tests for private methods option is disabled, since the industry best practice is to test private methods by creating tests for the accessible methods that call them, rather than by creating tests for private methods directly. |
You can create a parameterized JUnit 5 test from an existing non-parameterized test from the UTA view.
Cloning an existing test as a parameterized test does not affect the original test. The existing literal values that are passed to the method under test will become test parameters. The values will be moved into a single row of data for the new test.