From 760e4960881071c3fab2206c0cf335c2e0ce1c8c Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Tue, 18 Oct 2016 13:58:01 +0200 Subject: [PATCH] remove superficial line breaks from test method templates (IDEA-162465) --- .../src/com/intellij/testIntegration/TestIntegrationUtils.java | 2 +- .../test/com/intellij/junit5/JUnit5GenerationTest.java | 1 - .../testng/inspection/TestNGDataProviderInspection.java | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/java/java-impl/src/com/intellij/testIntegration/TestIntegrationUtils.java b/java/java-impl/src/com/intellij/testIntegration/TestIntegrationUtils.java index 3fab506c5078..b3f34a71053f 100644 --- a/java/java-impl/src/com/intellij/testIntegration/TestIntegrationUtils.java +++ b/java/java-impl/src/com/intellij/testIntegration/TestIntegrationUtils.java @@ -251,7 +251,7 @@ public class TestIntegrationUtils { } } - templateText = StringUtil.replace(templateText, "${BODY}", ""); + templateText = StringUtil.replace(templateText, "${BODY}\n", ""); int from = 0; while (true) { diff --git a/plugins/junit5_rt_tests/test/com/intellij/junit5/JUnit5GenerationTest.java b/plugins/junit5_rt_tests/test/com/intellij/junit5/JUnit5GenerationTest.java index 940d8bb12257..8ab147987c75 100644 --- a/plugins/junit5_rt_tests/test/com/intellij/junit5/JUnit5GenerationTest.java +++ b/plugins/junit5_rt_tests/test/com/intellij/junit5/JUnit5GenerationTest.java @@ -43,7 +43,6 @@ class JUnit5GenerationTest extends JUnit5CodeInsightTest { " @Test\n" + " void name() {\n" + " \n" + - "\n" + " }\n" + "}}"); } diff --git a/plugins/testng/src/com/theoryinpractice/testng/inspection/TestNGDataProviderInspection.java b/plugins/testng/src/com/theoryinpractice/testng/inspection/TestNGDataProviderInspection.java index a2f806e33b26..f19cc7191961 100644 --- a/plugins/testng/src/com/theoryinpractice/testng/inspection/TestNGDataProviderInspection.java +++ b/plugins/testng/src/com/theoryinpractice/testng/inspection/TestNGDataProviderInspection.java @@ -90,7 +90,7 @@ public class TestNGDataProviderInspection extends BaseJavaLocalInspectionTool { final Properties attributes = new Properties(); attributes.put(FileTemplate.ATTRIBUTE_NAME, name); body = fileTemplate.getText(attributes); - body = body.replace("${BODY}", ""); + body = body.replace("${BODY}\n", ""); final PsiMethod methodFromTemplate = JavaPsiFacade.getElementFactory(providerClass.getProject()).createMethodFromText(body, providerClass); final PsiCodeBlock methodBody = methodFromTemplate.getBody(); if (methodBody != null) {