diff --git a/plugins/gradle/java/src/execution/test/runner/GradleTestEventsProcessor.java b/plugins/gradle/java/src/execution/test/runner/GradleTestEventsProcessor.java index 096ad19a3ea4..a9d6ade0ea60 100644 --- a/plugins/gradle/java/src/execution/test/runner/GradleTestEventsProcessor.java +++ b/plugins/gradle/java/src/execution/test/runner/GradleTestEventsProcessor.java @@ -53,7 +53,7 @@ public class GradleTestEventsProcessor { } } if (event instanceof ExternalSystemFinishEvent) { - if (descriptor.getMethodName() == null) { + if (StringUtil.isEmpty(descriptor.getMethodName())) { return TestEventType.AFTER_SUITE; } else { return TestEventType.AFTER_TEST; diff --git a/plugins/gradle/java/testSources/execution/test/GradleJavaTestEventsIntegrationTest.kt b/plugins/gradle/java/testSources/execution/test/GradleJavaTestEventsIntegrationTest.kt index 568e722729fc..dd485ebf6f07 100644 --- a/plugins/gradle/java/testSources/execution/test/GradleJavaTestEventsIntegrationTest.kt +++ b/plugins/gradle/java/testSources/execution/test/GradleJavaTestEventsIntegrationTest.kt @@ -2,7 +2,6 @@ package org.jetbrains.plugins.gradle.execution.test import com.intellij.openapi.externalSystem.model.task.* -import com.intellij.openapi.externalSystem.model.task.event.ExternalSystemProgressEvent import com.intellij.openapi.externalSystem.model.task.event.ExternalSystemTaskExecutionEvent import com.intellij.openapi.externalSystem.model.task.event.TestOperationDescriptor import com.intellij.openapi.util.Pair @@ -115,9 +114,9 @@ open class GradleJavaTestEventsIntegrationTest: GradleImportingTestCase() { private fun extractTestClassesAndMethods(testListener: LoggingESStatusChangeListener) = testListener.eventLog .filterIsInstance() - .map { it.progressEvent } - .filterIsInstance>() - .map { it.descriptor.run { className to methodName } } + .map { it.progressEvent.descriptor } + .filterIsInstance() + .map { it.run { className to methodName } } private fun `call test task produces test events`() { val testEventListener = LoggingESStatusChangeListener() @@ -211,9 +210,9 @@ open class GradleJavaTestEventsIntegrationTest: GradleImportingTestCase() { if (testLauncherAPISupported()) { val testOperationDescriptors = testEventListener.eventLog .filterIsInstance() - .map { it.progressEvent } - .filterIsInstance>() - .map { it.descriptor.run { "$className$$methodName" to displayName } } + .map { it.progressEvent.descriptor } + .filterIsInstance() + .map { it.run { "$className$$methodName" to displayName } } assertThat(testOperationDescriptors) .contains("my.otherpack.ADisplayNamedTest\$successful_test()" to "successful test") diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/service/execution/GradleExecutionHelper.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/service/execution/GradleExecutionHelper.java index 85ec4b75da8d..3834e7a16956 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/service/execution/GradleExecutionHelper.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/service/execution/GradleExecutionHelper.java @@ -685,7 +685,7 @@ public class GradleExecutionHelper { * Args list will contain all other known arguments. * * @param args full command line - * @return test tasks geouped with its patterns + * @return test tasks grouped with its patterns */ static MultiMap extractTestCommandOptions(@NotNull List args) { MultiMap taskToTestsPatterns = new MultiMap<>();