- Notifications
You must be signed in to change notification settings - Fork 45
Add specific annotations for Spring integration testing #2281
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
Add specific annotations for Spring integration testing #2281
Conversation
5a2eae1 to b35a614 Compare
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.
It's also desirable to add @Transactional and @AutoConfigureTestDatabase if they are present on the test module class path.
.../src/main/kotlin/org/utbot/framework/codegen/tree/CgSpringIntegrationTestClassConstructor.kt Outdated Show resolved Hide resolved
a101ee3 to de7c03f Compare de7c03f to dadf0bf Compare .../src/main/kotlin/org/utbot/framework/codegen/tree/CgSpringIntegrationTestClassConstructor.kt Outdated Show resolved Hide resolved
...ework/src/main/kotlin/org/utbot/framework/codegen/services/framework/TestFrameworkManager.kt Outdated Show resolved Hide resolved
...ework/src/main/kotlin/org/utbot/framework/codegen/services/framework/TestFrameworkManager.kt Outdated Show resolved Hide resolved
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/CgStatementConstructor.kt Outdated Show resolved Hide resolved
utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/util/SpringModelUtils.kt Show resolved Hide resolved
utbot-js/src/main/kotlin/framework/codegen/model/constructor/tree/JsTestFrameworkManager.kt Outdated Show resolved Hide resolved
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/models/CgElement.kt Outdated Show resolved Hide resolved
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/CgMethodConstructor.kt Outdated Show resolved Hide resolved
.../src/main/kotlin/org/utbot/framework/codegen/tree/CgSpringIntegrationTestClassConstructor.kt Outdated Show resolved Hide resolved
utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/util/SpringModelUtils.kt Outdated Show resolved Hide resolved
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt Show resolved Hide resolved
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/context/CgContext.kt Show resolved Hide resolved
utbot-js/src/main/kotlin/framework/codegen/model/constructor/tree/JsCgStatementConstructor.kt Outdated Show resolved Hide resolved
utbot-js/src/main/kotlin/framework/codegen/model/constructor/tree/JsTestFrameworkManager.kt Outdated Show resolved Hide resolved
utbot-js/src/main/kotlin/framework/codegen/model/constructor/tree/JsTestFrameworkManager.kt Outdated Show resolved Hide resolved
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.
There are a lot of possibly dangerous changes connected with CgJavaGetClass. I suggest removing these changes from this PR and moving them to another PR
utbot-js/src/main/kotlin/framework/codegen/model/constructor/tree/JsCgStatementConstructor.kt Outdated Show resolved Hide resolved
utbot-js/src/main/kotlin/framework/codegen/model/constructor/tree/JsCgStatementConstructor.kt Outdated Show resolved Hide resolved
| | ||
| // Annotations | ||
| | ||
| enum class AnnotationTarget { |
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.
May we use kotlin.annotation.AnnotationTarget instead of creating our own type?
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.
Bue... it may lead the user to a wrong concern that we support or going to support all items from it. Next, in current implementation we are able to do smth like Class(classId) to specify the scope of current or outer class, for example. After that, do not forget that we get salary for the changed lines...
| | ||
| /** | ||
| * NOTE: use `StatementConstructor.addAnnotation` | ||
| * instead of explicit constructor call. |
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.
I guess, it's more preferrable to replace all these warnings with TODOs for rearranging packages/classes
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.
I'm not sure it will be ever done in current codegen. We know about packaging in general. I added this warnings just for other users to avoid additional mess in the code.
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.
I'm not sure it will be ever done in current codegen
Perhaps it will not, but IMHO todo is much more notable than such a simple comment.
...framework/src/main/kotlin/org/utbot/framework/codegen/services/access/CgFieldStateManager.kt Outdated Show resolved Hide resolved
| } | ||
| | ||
| override fun createDataProviderAnnotations(dataProviderMethodName: String) = mutableListOf<CgAnnotation>() | ||
| override fun addDataProviderAnnotations(dataProviderMethodName: String) { } |
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.
Same as for TestNg
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.
There is not an error, just annotation is not required.
...ework/src/main/kotlin/org/utbot/framework/codegen/services/framework/TestFrameworkManager.kt Outdated Show resolved Hide resolved
...ework/src/main/kotlin/org/utbot/framework/codegen/services/framework/TestFrameworkManager.kt Outdated Show resolved Hide resolved
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/CgMethodConstructor.kt Outdated Show resolved Hide resolved
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/CgStatementConstructor.kt Outdated Show resolved Hide resolved
Damtev 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
Fixes #2317
How to test
Should be tested as a part of full integration testing checks.
Self-check list