-
Notifications
You must be signed in to change notification settings - Fork 45
Support user-defined configurations and profiles in Spring integration test code generation #2351
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
Conversation
cca0679 to
c325091
Compare
utbot-ui-commons/src/main/kotlin/org/utbot/intellij/plugin/util/PsiClassUtil.kt
Outdated
Show resolved
Hide resolved
utbot-ui-commons/src/main/kotlin/org/utbot/intellij/plugin/models/BaseTestModel.kt
Outdated
Show resolved
Hide resolved
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/util/SpringConfigurationsHelper.kt
Show resolved
Hide resolved
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/UtTestsDialogProcessor.kt
Outdated
Show resolved
Hide resolved
utbot-ui-commons/src/main/kotlin/org/utbot/intellij/plugin/util/PsiClassUtil.kt
Outdated
Show resolved
Hide resolved
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/util/SpringConfigurationsHelper.kt
Outdated
Show resolved
Hide resolved
|
|
||
| } | ||
|
|
||
| enum class SpringConfigurationType( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of enum I suggest to introduce sealed interface SpringConfig with two implementations and use SpringConfig type to denote Spring configs instead of simply using String. We can choose appropriate implementation of SpringConfig in functions responsible for finding xml and Java configs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed in person, it was decided to leave as it is for now.
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/UtTestsDialogProcessor.kt
Outdated
Show resolved
Hide resolved
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/util/SpringConfigurationsHelper.kt
Outdated
Show resolved
Hide resolved
c325091 to
37d2982
Compare
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/generator/SpringCodeGenerator.kt
Outdated
Show resolved
Hide resolved
.../src/main/kotlin/org/utbot/framework/codegen/tree/CgSpringIntegrationTestClassConstructor.kt
Show resolved
Hide resolved
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt
Outdated
Show resolved
Hide resolved
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/UtTestsDialogProcessor.kt
Outdated
Show resolved
Hide resolved
37d2982 to
ca044a3
Compare
ca044a3 to
b91f0d0
Compare
utbot-spring-commons-api/src/main/kotlin/org/utbot/spring/api/context/ContextWrapper.kt
Outdated
Show resolved
Hide resolved
utbot-spring-commons/src/main/kotlin/org/utbot/spring/environment/EnvironmentFactory.kt
Outdated
Show resolved
Hide resolved
IlyaMuravjov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM
Description
This PR adds support for user-defined configurations and profiles in Spring integration tests
Also, this PR has fixes for inner class Spring configurations.
Fixes #2292, #2338
How to test
Manual tests
Checking annotations in integration tests:
Checking inner class configuration: