Tests type and configuration
Unit tests can be generated in No Configuration and Spring configuration mode.
Integration tests can be generated only with existing Spring configuration.
Tests type and mock strategy
Unit tests are generated with Engine only.
- in
No configuration mode any mock strategy can be used, default one is Mock everything outside the class.
- in
Spring configuration mode is defaulted to Mock using Spring configuration and disabled.
Integration tests are generated with Fuzzing only, so mocking is defaulted to Do not mock and disabled.
Tests type and other settings
Environment
IntelliJ IDEA Ultimate 2023.1
Summarizing. How UI is working in Spring projects
- If Spring dependency is detected, there appear 3 additional controls:
Spring configuration, Tests type, Active profiles
They influence one another, Mocking strategy, Mock static methods and Parameterized tests
- If
No configuration is selected,
a. Tests type = Unit tests and disabled
b. Active profiles = default and disabled
c. Mocking strategy is enabled can have any value from regular suggestion list
- When some
Spring configuration is selected from list of suggestions,
a. Tests type = Unit tests by default,
b. if existing Spring configuration is selected and it is not XML-based - Integration tests is present in list of suggestions for Tests type
c. Parameterized tests = false and disabled
- If one of XML-based configurations is selected as
Spring configuration,
a. Tests type = Unit tests
- When
Unit tests is selected together with one of existing Spring configuration,
a. Mocking strategy = Mock using Spring configuration and disabled
b. Mock static methods = true and disabled
- When
Integration tests is selected together with one of existing Spring configuration,
a. Mocking strategy = Do not mock and disabled
b. Mock static methods = false and disabled
- If
Mocking strategy is Do not mock - with or without Spring configuration,
a. Mock static methods = false and disabled
Tests type and configuration
Unit tests can be generated in
No ConfigurationandSpring configurationmode.Integration tests can be generated only with existing
Spring configuration.Tests type and mock strategy
Unit tests are generated with Engine only.
No configurationmode any mock strategy can be used, default one isMock everything outside the class.Spring configurationmode is defaulted toMock using Spring configurationand disabled.Integration tests are generated with Fuzzing only, so mocking is defaulted to
Do not mockand disabled.Tests type and other settings
No ConfigurationorXML configurationis selected, Tests type is disabled and defaulted toUnit tests.Integration testsandUnit tests.Integration testsis selected, Test frameworks must containJUnit4andJUnit5TestNGmust disappear from the list of suggestions.Integration testsis selected,XML configurationlist must disappear from the list of suggestions in Spring configuration.Environment
IntelliJ IDEA Ultimate 2023.1
Summarizing. How UI is working in Spring projects
Spring configuration,Tests type,Active profilesThey influence one another,
Mocking strategy,Mock static methodsandParameterized testsNo configurationis selected,a.
Tests type=Unit testsand disabledb.
Active profiles=defaultand disabledc.
Mocking strategyis enabled can have any value from regular suggestion listSpring configurationis selected from list of suggestions,a.
Tests type=Unit testsby default,b. if existing Spring configuration is selected and it is not XML-based -
Integration testsis present in list of suggestions forTests typec.
Parameterized tests= false and disabledSpring configuration,a.
Tests type=Unit testsUnit testsis selected together with one of existingSpring configuration,a.
Mocking strategy=Mock using Spring configurationand disabledb.
Mock static methods= true and disabledIntegration testsis selected together with one of existingSpring configuration,a.
Mocking strategy=Do not mockand disabledb.
Mock static methods= false and disabledMocking strategyisDo not mock- with or withoutSpring configuration,a.
Mock static methods= false and disabled