From 078215a188a06d3fcaf4b39d8f652ab2ffdc6756 Mon Sep 17 00:00:00 2001 From: "Vassiliy.Kudryashov" Date: Tue, 5 Jul 2022 19:22:50 +0300 Subject: [PATCH] Existing test file without test class obstruct generation #160 --- .../kotlin/org/utbot/intellij/plugin/generator/TestGenerator.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/TestGenerator.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/TestGenerator.kt index b6832b9f2f..b27bd8d365 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/TestGenerator.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/TestGenerator.kt @@ -207,6 +207,7 @@ object TestGenerator { CodegenLanguage.KOTLIN -> "Kotlin Class" } ) + runWriteAction { testDirectory.findFile(testClassName + model.codegenLanguage.extension)?.delete() } val createFromTemplate: PsiElement = FileTemplateUtil.createFromTemplate( fileTemplate, testClassName,