Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Integration tests UI changes #2266

Closed
4 tasks done
alisevych opened this issue Jun 7, 2023 · 4 comments · Fixed by #2369
Closed
4 tasks done

Spring Integration tests UI changes #2266

alisevych opened this issue Jun 7, 2023 · 4 comments · Fixed by #2369
Assignees
Labels
comp-spring Issue is related to Spring projects support comp-ui Improvements of plugin UI appearence and functionality ctg-enhancement New feature, improvement or change request

Comments

@alisevych
Copy link
Member

alisevych commented Jun 7, 2023

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

  • When No Configuration or XML configuration is selected, Tests type is disabled and defaulted to Unit tests.
  • When existing Spring configuration is selected (excluding XML configurations), Tests type is enabled and two options available: Integration tests and Unit tests.
  • When Integration tests is selected, Test frameworks must contain JUnit4 and JUnit5
    TestNG must disappear from the list of suggestions.
  • When Integration tests is selected, XML configuration list must disappear from the list of suggestions in Spring configuration.

Environment

IntelliJ IDEA Ultimate 2023.1

Summarizing. How UI is working in Spring projects

  1. 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
  2. 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
  3. 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
  4. If one of XML-based configurations is selected as Spring configuration,
    a. Tests type = Unit tests
  5. 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
  6. 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
  7. If Mocking strategy is Do not mock - with or without Spring configuration,
    a. Mock static methods = false and disabled
@alisevych alisevych added the ctg-enhancement New feature, improvement or change request label Jun 7, 2023
@alisevych alisevych added this to the Spring Phase 3 milestone Jun 7, 2023
@alisevych alisevych added comp-ui Improvements of plugin UI appearence and functionality comp-spring Issue is related to Spring projects support labels Jun 7, 2023
@IlyaMuravjov
Copy link
Collaborator

Right now fuzzer can only generate null for most of the interface types (except some collections, for which custom ValueProviders have been written). When we can't generate value other than null we should at least consider using mocks, which will contradict the premise of this issue, stating that: "[if we use] fuzzing only, [then] mocking is not available at all"

@alisevych
Copy link
Member Author

alisevych commented Jul 5, 2023

@IlyaMuravjov This issue is about settings available on UI only.
Currently Fuzzing is not supporting mocks. So Mocking settings should not be available.
When - If - this changes, settings on UI can be changed respectively.

@tepa46 tepa46 linked a pull request Jul 5, 2023 that will close this issue
6 tasks
@alisevych
Copy link
Member Author

alisevych commented Jul 5, 2023

@EgorkaKulikov
Let's consider the following conflict case:

  • User selects XML-based configuration in Spring configuration field.
  • User selects Integration tests in Tests type

Shall we hide Integration tests after the first step?
Updated the first point accordingly.

@alisevych
Copy link
Member Author

alisevych commented Jul 5, 2023

Also I would not exclude XML configuration list from suggestions when Integration tests are selected.
Just if user selects one of XMLs, Unit tests are selected.
Why?
To keep priority and consistency of Spring configuration control.
Otherwise user select Integration tests - and then do not understand, where are all the configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-spring Issue is related to Spring projects support comp-ui Improvements of plugin UI appearence and functionality ctg-enhancement New feature, improvement or change request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants