-
Notifications
You must be signed in to change notification settings - Fork 46
Introduce and test UtBotSpringApi
#2632
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
…ith `PresentSpringSettings`
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt
Show resolved
Hide resolved
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/UtTestsDialogProcessor.kt
Show resolved
Hide resolved
* hence call to this method is added into them to ensure they are actually never called. | ||
*/ | ||
public static void shouldNeverBeCalled() { | ||
System.err.println("shouldNeverBeCalled() is unexpectedly called"); |
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.
Will we see this message in log on CI? If yes, maybe stack trace would be more useful.
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 doubt we will see it on CI. Spring analyzer runs in a separate process and similarly to instrumented process it uses RD logger to send logs to engine process which can actually print them. However, RD logger isn't configured in the sample Spring project.
So if these tests start failing due to Spring analyzer initializing beans it may take some time to debug them and find the problem, but it's unlikely, so I think it's not worth configuring RD logger in sample Spring project now.
public void testOnAbsentSpringSettings() { | ||
SpringApplicationContext springApplicationContext = | ||
UtBotSpringApi.createSpringApplicationContext( | ||
SpringSettings.AbsentSpringSettings.INSTANCE, |
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.
We can turn AbsentSpringSettings into companion object and get rid of the INSTANCE call
Description
Add
UtBotSpringApi
that helpsUtBotJavaApi
users createSpringApplicationContext
to run Spring-specific test generation (see #2614)How to test
Automated tests
Self-check list