Finally was able to remove JUnit workaround for test invokation with availability of JUnit 5.5.0-RC1.

This commit is contained in:
Chris Hodges 2019-06-09 14:17:44 +02:00
parent 828e61a73b
commit 6795622202
21 changed files with 201 additions and 309 deletions

View File

@ -22,8 +22,8 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
testCompile "org.assertj:assertj-core:3.12.2"
testCompile "org.assertj:assertj-guava:3.2.1"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.5.0-RC1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.5.0-RC1'
testImplementation "org.jetbrains.kotlin:kotlin-test"
// testImplementation "org.jetbrains.kotlin:kotlin-test-junit"
}

View File

@ -8,9 +8,8 @@ import com.intellij.openapi.roots.ModifiableRootModel;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.PsiTestUtil;
import com.intellij.testFramework.UsefulTestCase;
import com.intellij.testFramework.*;
import com.intellij.testFramework.fixtures.IdeaTestExecutionPolicy;
import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture;
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
import org.jetbrains.annotations.NotNull;
@ -19,6 +18,7 @@ import org.junit.jupiter.api.extension.ExtensionContext.Namespace;
import org.junit.jupiter.api.extension.ExtensionContext.Store;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.net.URISyntaxException;
import java.nio.file.Path;
@ -26,7 +26,7 @@ import java.nio.file.Paths;
import java.util.logging.Logger;
import java.util.stream.Stream;
public class LightCodeInsightExtension implements ParameterResolver, AfterTestExecutionCallback {
public class LightCodeInsightExtension implements ParameterResolver, AfterTestExecutionCallback, InvocationInterceptor {
private static final Logger LOG = Logger.getLogger(LightCodeInsightExtension.class.getName());
@ -77,6 +77,41 @@ public class LightCodeInsightExtension implements ParameterResolver, AfterTestEx
return context.getStore(Namespace.create(LightCodeInsightExtension.class, context.getRequiredTestMethod()));
}
@Override
public void interceptTestMethod(Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) throws Throwable {
Throwable[] throwables = new Throwable[1];
Runnable runnable = () -> {
try {
TestLoggerFactory.onTestStarted();
invocation.proceed();
TestLoggerFactory.onTestFinished(true);
} catch (Throwable e) {
TestLoggerFactory.onTestFinished(false);
e.fillInStackTrace();
throwables[0] = e;
}
};
invokeTestRunnable(runnable);
if (throwables[0] != null) {
throw throwables[0];
}
}
private static void invokeTestRunnable(@NotNull Runnable runnable) {
IdeaTestExecutionPolicy policy = IdeaTestExecutionPolicy.current();
if (policy != null && !policy.runInDispatchThread()) {
runnable.run();
} else {
EdtTestUtilKt.runInEdtAndWait(() -> {
runnable.run();
return null;
});
}
}
private static class LightCodeInsightFixtureTestCaseWrapper extends LightCodeInsightFixtureTestCase {
private final ExtensionContext extensionContext;

View File

@ -1,44 +0,0 @@
package de.platon42.intellij.jupiter;
import com.intellij.testFramework.EdtTestUtilKt;
import com.intellij.testFramework.TestLoggerFactory;
import com.intellij.testFramework.fixtures.IdeaTestExecutionPolicy;
import org.jetbrains.annotations.NotNull;
// See https://github.com/junit-team/junit5/issues/157
public class WorkaroundUntilJupiterGetsExecutorProvider {
protected static void runTest(Runnable test) throws Throwable {
Throwable[] throwables = new Throwable[1];
Runnable runnable = () -> {
try {
TestLoggerFactory.onTestStarted();
test.run();
TestLoggerFactory.onTestFinished(true);
} catch (Throwable e) {
TestLoggerFactory.onTestFinished(false);
e.fillInStackTrace();
throwables[0] = e;
}
};
invokeTestRunnable(runnable);
if (throwables[0] != null) {
throw throwables[0];
}
}
private static void invokeTestRunnable(@NotNull Runnable runnable) {
IdeaTestExecutionPolicy policy = IdeaTestExecutionPolicy.current();
if (policy != null && !policy.runInDispatchThread()) {
runnable.run();
} else {
EdtTestUtilKt.runInEdtAndWait(() -> {
runnable.run();
return null;
});
}
}
}

View File

@ -1,10 +1,7 @@
package de.platon42.intellij.plugins.cajon
import com.intellij.pom.java.LanguageLevel
import com.intellij.testFramework.TestLoggerFactory
import com.intellij.testFramework.fixtures.IdeaTestExecutionPolicy
import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture
import com.intellij.testFramework.runInEdtAndWait
import de.platon42.intellij.jupiter.AddLocalJarToModule
import de.platon42.intellij.jupiter.LightCodeInsightExtension
import de.platon42.intellij.jupiter.TestDataPath
@ -14,7 +11,6 @@ import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.DisplayNameGeneration
import org.junit.jupiter.api.DisplayNameGenerator
import org.junit.jupiter.api.extension.ExtendWith
import java.lang.reflect.InvocationTargetException
import java.lang.reflect.Method
@ExtendWith(LightCodeInsightExtension::class)
@ -24,45 +20,6 @@ import java.lang.reflect.Method
@DisplayNameGeneration(AbstractCajonTest.CutOffFixtureDisplayNameGenerator::class)
abstract class AbstractCajonTest {
// See https://github.com/junit-team/junit5/issues/157, should be resolved with junit5 5.5 M2
protected fun runTest(body: () -> Unit) {
val throwables = arrayOfNulls<Throwable>(1)
invokeTestRunnable {
try {
TestLoggerFactory.onTestStarted()
body()
TestLoggerFactory.onTestFinished(true)
} catch (e: InvocationTargetException) {
TestLoggerFactory.onTestFinished(false)
e.fillInStackTrace()
throwables[0] = e.targetException
} catch (e: IllegalAccessException) {
TestLoggerFactory.onTestFinished(false)
e.fillInStackTrace()
throwables[0] = e
} catch (e: Throwable) {
TestLoggerFactory.onTestFinished(false)
throwables[0] = e
}
}
if (throwables[0] != null) {
throw throwables[0]!!
}
}
private fun invokeTestRunnable(runnable: () -> Unit) {
val policy = IdeaTestExecutionPolicy.current()
if (policy != null && !policy.runInDispatchThread()) {
runnable()
} else {
runInEdtAndWait {
runnable()
}
}
}
protected fun executeQuickFixes(myFixture: JavaCodeInsightTestFixture, regex: Regex, expectedFixes: Int) {
val quickfixes = myFixture.getAllQuickFixes().filter { it.text.matches(regex) }
assertThat(quickfixes).`as`("Fixes matched by $regex: ${myFixture.getAllQuickFixes().map { it.text }}").hasSize(expectedFixes)

View File

@ -11,7 +11,6 @@ internal class AssertThatBinaryExpressionInspectionTest : AbstractCajonTest() {
@Test
@TestDataSubPath("inspections/BinaryExpression")
internal fun assertThat_of_binary_expression_can_be_moved_out(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(AssertThatBinaryExpressionInspection::class.java)
myFixture.configureByFile("BinaryExpressionBefore.java")
executeQuickFixes(myFixture, Regex.fromLiteral("Split binary expression out of assertThat()"), 149)
@ -19,4 +18,3 @@ internal class AssertThatBinaryExpressionInspectionTest : AbstractCajonTest() {
myFixture.checkResultByFile("BinaryExpressionAfter.java")
}
}
}

View File

@ -11,7 +11,6 @@ internal class AssertThatBooleanConditionInspectionTest : AbstractCajonTest() {
@Test
@TestDataSubPath("inspections/BooleanCondition")
internal fun assertThat_with_isEqualTo_true_or_false_can_use_isTrue_or_isFalse(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(AssertThatBooleanConditionInspection::class.java)
myFixture.configureByFile("BooleanConditionBefore.java")
executeQuickFixes(myFixture, Regex.fromLiteral("Replace isEqualTo() with isTrue()"), 6)
@ -21,4 +20,3 @@ internal class AssertThatBooleanConditionInspectionTest : AbstractCajonTest() {
myFixture.checkResultByFile("BooleanConditionAfter.java")
}
}
}

View File

@ -11,7 +11,6 @@ internal class AssertThatCollectionOrMapExpressionInspectionTest : AbstractCajon
@Test
@TestDataSubPath("inspections/CollectionMapExpression")
internal fun assertThat_with_certain_Collection_and_Map_methods(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(AssertThatCollectionOrMapExpressionInspection::class.java)
myFixture.configureByFile("CollectionMapExpressionBefore.java")
executeQuickFixes(myFixture, Regex.fromLiteral("Remove isEmpty() of actual expression and use assertThat().isEmpty() instead"), 4)
@ -26,4 +25,3 @@ internal class AssertThatCollectionOrMapExpressionInspectionTest : AbstractCajon
myFixture.checkResultByFile("CollectionMapExpressionAfter.java")
}
}
}

View File

@ -11,11 +11,9 @@ internal class AssertThatEnumerableIsEmptyInspectionTest : AbstractCajonTest() {
@Test
@TestDataSubPath("inspections/EnumerableIsEmpty")
internal fun assertThat_with_hasSize_zero_can_use_isEmpty(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(AssertThatEnumerableIsEmptyInspection::class.java)
myFixture.configureByFile("EnumerableIsEmptyBefore.java")
executeQuickFixes(myFixture, Regex.fromLiteral("Replace hasSize() with isEmpty()"), 5)
myFixture.checkResultByFile("EnumerableIsEmptyAfter.java")
}
}
}

View File

@ -14,7 +14,6 @@ internal class AssertThatGuavaOptionalInspectionTest : AbstractCajonTest() {
@Test
internal fun assertThat_get_or_isPresent_for_Guava_Optional_can_be_simplified(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(AssertThatGuavaOptionalInspection::class.java)
myFixture.configureByFile("GuavaOptionalBefore.java")
executeQuickFixes(myFixture, Regex.fromLiteral("Remove isPresent() of actual expression and use assertThat().isPresent() instead"), 6)
@ -27,22 +26,18 @@ internal class AssertThatGuavaOptionalInspectionTest : AbstractCajonTest() {
executeQuickFixes(myFixture, Regex.fromLiteral("Replace isNotEqualTo() with Guava assertThat().isPresent()"), 3)
myFixture.checkResultByFile("GuavaOptionalAfter.java")
}
}
@Test
internal fun adds_missing_Guava_import_any_order(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(AssertThatGuavaOptionalInspection::class.java)
myFixture.configureByFile("WithoutPriorGuavaImportBefore.java")
executeQuickFixes(myFixture, Regex(".*eplace .* with .*"), 4)
executeQuickFixes(myFixture, Regex("Remove .*"), 3)
myFixture.checkResultByFile("WithoutPriorGuavaImportAfter.java")
}
}
@Test
internal fun adds_missing_Guava_import_isAbsent_first(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(AssertThatGuavaOptionalInspection::class.java)
myFixture.configureByFile("WithoutPriorGuavaImportBefore.java")
executeQuickFixes(myFixture, Regex.fromLiteral("Replace isEqualTo() with Guava assertThat().isAbsent()"), 1)
@ -51,4 +46,3 @@ internal class AssertThatGuavaOptionalInspectionTest : AbstractCajonTest() {
myFixture.checkResultByFile("WithoutPriorGuavaImportAfter.java")
}
}
}

View File

@ -11,7 +11,6 @@ internal class AssertThatInstanceOfInspectionTest : AbstractCajonTest() {
@Test
@TestDataSubPath("inspections/InstanceOf")
internal fun assertThat_with_instanceof_can_be_moved_out(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(AssertThatInstanceOfInspection::class.java)
myFixture.configureByFile("InstanceOfBefore.java")
executeQuickFixes(myFixture, Regex.fromLiteral("Remove instanceof in actual expression and use assertThat().isInstanceOf() instead"), 6)
@ -19,4 +18,3 @@ internal class AssertThatInstanceOfInspectionTest : AbstractCajonTest() {
myFixture.checkResultByFile("InstanceOfAfter.java")
}
}
}

View File

@ -11,11 +11,9 @@ internal class AssertThatInvertedBooleanConditionInspectionTest : AbstractCajonT
@Test
@TestDataSubPath("inspections/InvertedBooleanCondition")
internal fun assertThat_with_inverted_boolean_condition_can_be_inverted(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(AssertThatInvertedBooleanConditionInspection::class.java)
myFixture.configureByFile("InvertedBooleanConditionBefore.java")
executeQuickFixes(myFixture, Regex.fromLiteral("Invert condition in assertThat()"), 25)
myFixture.checkResultByFile("InvertedBooleanConditionAfter.java")
}
}
}

View File

@ -11,7 +11,6 @@ internal class AssertThatJava8OptionalInspectionTest : AbstractCajonTest() {
@Test
@TestDataSubPath("inspections/Java8Optional")
internal fun assertThat_get_or_isPresent_for_Java8_Optional_can_be_simplified(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(AssertThatJava8OptionalInspection::class.java)
myFixture.configureByFile("Java8OptionalBefore.java")
executeQuickFixes(myFixture, Regex.fromLiteral("Remove isPresent() of actual expression and use assertThat().isPresent() instead"), 6)
@ -26,4 +25,3 @@ internal class AssertThatJava8OptionalInspectionTest : AbstractCajonTest() {
myFixture.checkResultByFile("Java8OptionalAfter.java")
}
}
}

View File

@ -11,7 +11,6 @@ internal class AssertThatObjectIsNullOrNotNullInspectionTest : AbstractCajonTest
@Test
@TestDataSubPath("inspections/ObjectIsNullOrNotNull")
internal fun assertThat_with_isEqualTo_null_can_use_isNull(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(AssertThatObjectIsNullOrNotNullInspection::class.java)
myFixture.configureByFile("ObjectIsNullOrNotNullBefore.java")
executeQuickFixes(myFixture, Regex.fromLiteral("Replace isEqualTo() with isNull()"), 4)
@ -19,4 +18,3 @@ internal class AssertThatObjectIsNullOrNotNullInspectionTest : AbstractCajonTest
myFixture.checkResultByFile("ObjectIsNullOrNotNullAfter.java")
}
}
}

View File

@ -13,7 +13,6 @@ internal class AssertThatSizeInspectionTest : AbstractCajonTest() {
@Test
@TestDataSubPath("inspections/Size")
internal fun assertThat_size_of_array_or_collection_can_be_simplified(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(AssertThatSizeInspection::class.java)
myFixture.configureByFile("SizeBefore.java")
assertThat(myFixture.doHighlighting()).extrakting { it.description }.containsOnlyOnce("Try to operate on the iterable itself rather than its size")
@ -35,4 +34,3 @@ internal class AssertThatSizeInspectionTest : AbstractCajonTest() {
myFixture.checkResultByFile("SizeAfter.java")
}
}
}

View File

@ -11,7 +11,6 @@ internal class AssertThatStringExpressionInspectionTest : AbstractCajonTest() {
@Test
@TestDataSubPath("inspections/StringExpression")
internal fun assertThat_with_certain_String_methods(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(AssertThatStringExpressionInspection::class.java)
myFixture.configureByFile("StringExpressionBefore.java")
executeQuickFixes(myFixture, Regex.fromLiteral("Remove isEmpty() of actual expression and use assertThat().isEmpty() instead"), 2)
@ -31,4 +30,3 @@ internal class AssertThatStringExpressionInspectionTest : AbstractCajonTest() {
myFixture.checkResultByFile("StringExpressionAfter.java")
}
}
}

View File

@ -13,7 +13,6 @@ internal class AssertThatStringIsEmptyInspectionTest : AbstractCajonTest() {
@Test
@TestDataSubPath("inspections/StringIsEmpty")
internal fun assertThat_with_isEqualTo_emptyString_can_use_isEmpty(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(AssertThatStringIsEmptyInspection::class.java)
myFixture.configureByFile("StringIsEmptyBefore.java")
val highlights = myFixture.doHighlighting()
@ -26,4 +25,3 @@ internal class AssertThatStringIsEmptyInspectionTest : AbstractCajonTest() {
myFixture.checkResultByFile("StringIsEmptyAfter.java")
}
}
}

View File

@ -14,11 +14,9 @@ internal class AssumeThatInsteadOfReturnInspectionTest : AbstractCajonTest() {
@Test
@TestDataSubPath("inspections/AssumeThat")
internal fun conditional_returns_can_be_replaced_by_assumeThat(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(AssumeThatInsteadOfReturnInspection::class.java)
myFixture.configureByFile("AssumeThatBefore.java")
executeQuickFixes(myFixture, Regex.fromLiteral("Replace if statement by assumeTrue()"), 5)
myFixture.checkResultByFile("AssumeThatAfter.java")
}
}
}

View File

@ -14,7 +14,6 @@ internal class ImplicitAssertionInspectionTest : AbstractCajonTest() {
@Test
@TestDataSubPath("inspections/ImplicitAssertion")
internal fun implicit_assertions_can_be_removed(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(ImplicitAssertionInspection::class.java)
myFixture.configureByFile("ImplicitAssertionBefore.java")
executeQuickFixes(myFixture, Regex("Delete implicit isNotNull\\(\\) covered by .*"), 101)
@ -23,4 +22,3 @@ internal class ImplicitAssertionInspectionTest : AbstractCajonTest() {
myFixture.checkResultByFile("ImplicitAssertionAfter.java")
}
}
}

View File

@ -15,7 +15,6 @@ internal class JUnitAssertToAssertJInspectionTest : AbstractCajonTest() {
@Test
@TestDataSubPath("inspections/JUnitAssertToAssertJ")
internal fun junit_Assertions_can_be_converted_into_AssertJ(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(JUnitAssertToAssertJInspection::class.java)
myFixture.configureByFile("JUnitAssertToAssertJInspectionBefore.java")
executeQuickFixes(myFixture, Regex("Convert assert.*\\(\\) to assertThat\\(\\).*"), 48)
@ -23,4 +22,3 @@ internal class JUnitAssertToAssertJInspectionTest : AbstractCajonTest() {
myFixture.checkResultByFile("JUnitAssertToAssertJInspectionAfter.java")
}
}
}

View File

@ -11,11 +11,9 @@ internal class JoinAssertThatStatementsInspectionTest : AbstractCajonTest() {
@Test
@TestDataSubPath("inspections/JoinStatements")
internal fun assertThat_statements_can_be_joined_together(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.enableInspections(JoinAssertThatStatementsInspection::class.java)
myFixture.configureByFile("JoinStatementsBefore.java")
executeQuickFixes(myFixture, Regex.fromLiteral("Join assertThat() statements"), 5)
myFixture.checkResultByFile("JoinStatementsAfter.java")
}
}
}

View File

@ -13,81 +13,61 @@ internal class ExtractorReferenceContributorTest : AbstractCajonTest() {
@Test
internal fun extractor_is_able_to_find_reference_for_field_extracting(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.configureByFiles("FindReference1.java", "Address.java", "Contact.java")
assertThat(myFixture.elementAtCaret.text).isEqualTo("private String name;")
}
}
@Test
internal fun extractor_is_able_to_find_reference_for_first_part_of_a_path(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.configureByFiles("FindReference2.java", "Address.java", "Contact.java")
assertThat(myFixture.elementAtCaret.text).isEqualTo("protected Address address;")
}
}
@Test
internal fun extractor_is_able_to_find_reference_for_second_part_of_a_path_and_both_getter_and_field(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.configureByFiles("FindReference3.java", "Address.java", "Contact.java")
assertThat(myFixture.elementAtCaret.text).startsWith("private String street;")
}
}
@Test
internal fun extractor_is_able_to_find_reference_on_a_bare_method_call(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.configureByFiles("FindReference4.java", "Address.java", "Contact.java")
assertThat(myFixture.elementAtCaret.text).startsWith("public Boolean getREALLYnoMAILINGS()")
}
}
@Test
internal fun extractor_is_able_to_find_reference_with_only_Getter_on_second_part(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.configureByFiles("FindReference5.java", "Address.java", "Contact.java")
assertThat(myFixture.elementAtCaret.text).startsWith("public boolean isNoMailings()")
}
}
@Test
internal fun extractor_is_able_to_find_reference_using_byName_extractor(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.configureByFiles("FindReference6.java", "Address.java", "Contact.java")
assertThat(myFixture.elementAtCaret.text).isEqualTo("private String name;")
}
}
@Test
internal fun extractor_is_able_to_find_reference_using_resultOf_extractor(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.configureByFiles("FindReference7.java", "Address.java", "Contact.java")
assertThat(myFixture.elementAtCaret.text).startsWith("public String getStreetName()")
}
}
@Test
internal fun extractor_is_able_to_find_reference_for_field_extraction_on_list(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.configureByFiles("FindReference8.java", "Address.java", "Contact.java")
assertThat(myFixture.elementAtCaret.text).isEqualTo("private String name;")
}
}
@Test
internal fun extractor_is_able_to_find_reference_for_field_flat_extraction_of_path_on_list(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.configureByFiles("FindReference9.java", "Address.java", "Contact.java")
assertThat(myFixture.elementAtCaret.text).startsWith("private String street;")
}
}
@Test
internal fun extractor_is_able_to_find_reference_for_extraction_on_result_of_method(@MyFixture myFixture: JavaCodeInsightTestFixture) {
runTest {
myFixture.configureByFiles("FindReference10.java", "Address.java", "Contact.java")
assertThat(myFixture.elementAtCaret.text).startsWith("public String getStreetName()")
}
}
}