Move GradleQuickFixTest checks in EDT Thread

This commit is contained in:
Andrey Uskov
2020-04-28 11:52:23 +03:00
parent aa6801569a
commit 89777f8bf3
@@ -60,15 +60,17 @@ class GradleQuickFixTest : GradleImportingTestCase() {
} }
private fun applyInspectionFixes(tool: LocalInspectionTool, file: VirtualFile) { private fun applyInspectionFixes(tool: LocalInspectionTool, file: VirtualFile) {
invokeTestRunnable { runInEdtAndWait {
val presentation = runInspection(tool, myProject, listOf(file)) invokeTestRunnable {
val presentation = runInspection(tool, myProject, listOf(file))
WriteCommandAction.runWriteCommandAction(myProject) { WriteCommandAction.runWriteCommandAction(myProject) {
val foundProblems = presentation.problemElements.values.mapNotNull { it as? ProblemDescriptorBase } val foundProblems = presentation.problemElements.values.mapNotNull { it as? ProblemDescriptorBase }
for (problem in foundProblems) { for (problem in foundProblems) {
val fixes = problem.fixes val fixes = problem.fixes
if (fixes != null) { if (fixes != null) {
fixes[0].applyFix(myProject, problem) fixes[0].applyFix(myProject, problem)
}
} }
} }
} }