[lambda tests] AT-3508 Name test class conventionally

GitOrigin-RevId: e5965939d311d9d680bd9bddb2686def6507aa7a
This commit is contained in:
Nikita Kudrin
2025-11-10 19:38:52 +00:00
committed by intellij-monorepo-bot
parent 32b94df9e7
commit 22db5e900b
2 changed files with 12 additions and 16 deletions
@@ -2,8 +2,6 @@ package com.intellij.lambda.tests
import com.intellij.lambda.testFramework.junit.ExecuteInMonolithAndSplitMode
import com.intellij.lambda.testFramework.utils.BackgroundRunWithLambda
import com.intellij.lambda.tests.SampleTests.Companion.HelloBackendOnlyLambda
import com.intellij.lambda.tests.SampleTests.Companion.HelloFrontendOnlyLambda
import kotlinx.coroutines.runBlocking
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.TestInfo
@@ -18,7 +18,7 @@ import org.junit.jupiter.api.TestTemplate
import kotlin.time.Duration.Companion.seconds
@ExecuteInMonolithAndSplitMode
class SampleTests {
class SampleTest {
@TestTemplate
fun `serialized test`(ide: BackgroundRunWithLambda) = runBlocking {
//works in both modes if
@@ -46,21 +46,19 @@ class SampleTests {
ide.runLambdaInBackend(HelloBackendOnlyLambda::class)
ide.runLambda(HelloFrontendOnlyLambda::class)
}
}
companion object {
class HelloFrontendOnlyLambda(frontendIdeContext: LambdaFrontendContext, plugin: PluginModuleDescriptor)
: NamedLambda<LambdaFrontendContext>(frontendIdeContext, plugin) {
override suspend fun LambdaFrontendContext.lambda(args: List<LambdaRdKeyValueEntry>): Any {
return currentClassLogger().warn("Hi there Frontend")
}
}
class HelloFrontendOnlyLambda(frontendIdeContext: LambdaFrontendContext, plugin: PluginModuleDescriptor)
: NamedLambda<LambdaFrontendContext>(frontendIdeContext, plugin) {
override suspend fun LambdaFrontendContext.lambda(args: List<LambdaRdKeyValueEntry>): Any {
return currentClassLogger().warn("Hi there Frontend")
}
}
class HelloBackendOnlyLambda(backendIdeContext: LambdaBackendContext, plugin: PluginModuleDescriptor)
: NamedLambda<LambdaBackendContext>(backendIdeContext, plugin) {
override suspend fun LambdaBackendContext.lambda(args: List<LambdaRdKeyValueEntry>): Any {
return currentClassLogger().warn("Hi there Backend")
}
}
class HelloBackendOnlyLambda(backendIdeContext: LambdaBackendContext, plugin: PluginModuleDescriptor)
: NamedLambda<LambdaBackendContext>(backendIdeContext, plugin) {
override suspend fun LambdaBackendContext.lambda(args: List<LambdaRdKeyValueEntry>): Any {
return currentClassLogger().warn("Hi there Backend")
}
}