Skip to content

Commit af725e7

Browse files
Add disclaimer of generating Spring integration tests (#2618)
1 parent be47d83 commit af725e7

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
418418
"Mocks will be used when necessary."
419419
)
420420
}
421-
row("Tests type:") {
421+
row("Test type:") {
422422
cell(springTestType)
423423
contextHelp(
424424
"Unit tests do not initialize ApplicationContext <br>" +
@@ -667,6 +667,19 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
667667
}
668668

669669
override fun doOKAction() {
670+
if (isSpringConfigSelected()
671+
&& springTestType.selectedItem == INTEGRATION_TEST
672+
&& Messages.showYesNoDialog(
673+
model.project,
674+
"Generating \"Integration tests\" may lead to corrupting user data or inflicting other harm.\n" +
675+
"Please use a test configuration or profile.",
676+
"Warning",
677+
"Proceed",
678+
"Go Back",
679+
Messages.getWarningIcon()
680+
) != Messages.YES) {
681+
return;
682+
}
670683
fun now() = LocalDateTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss.SSS"))
671684

672685
logger.info { "Tests generation instantiation phase started at ${now()}" }

0 commit comments

Comments
 (0)