From f32fa80a8feb7c20fe805f2e595a2ad83c110d15 Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Thu, 8 Jan 2026 17:54:56 +0100 Subject: [PATCH] testFramework [platform]: Cleanup `RegistryKeyAppLevel` GitOrigin-RevId: 9bb2ae4238e3ddc0fec29ce572d2ae87cd6a63b1 --- .../testFramework/junit5/src/impl/RegistryKeyExtension.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/testFramework/junit5/src/impl/RegistryKeyExtension.kt b/platform/testFramework/junit5/src/impl/RegistryKeyExtension.kt index 550a7e7d0b3d..ff05d7a91bd9 100644 --- a/platform/testFramework/junit5/src/impl/RegistryKeyExtension.kt +++ b/platform/testFramework/junit5/src/impl/RegistryKeyExtension.kt @@ -5,8 +5,8 @@ import com.intellij.openapi.util.registry.Registry import com.intellij.openapi.util.registry.RegistryValue import com.intellij.testFramework.junit5.RegistryKey import com.intellij.testFramework.junit5.RegistryKeyAppLevel -import com.intellij.testFramework.junit5.impl.TypedStoreKey.Companion.getTyped -import com.intellij.testFramework.junit5.impl.TypedStoreKey.Companion.putTyped +import com.intellij.testFramework.junit5.impl.TypedStoreKey.Companion.get +import com.intellij.testFramework.junit5.impl.TypedStoreKey.Companion.set import org.jetbrains.annotations.TestOnly import org.junit.jupiter.api.extension.AfterAllCallback import org.junit.jupiter.api.extension.BeforeAllCallback @@ -27,13 +27,13 @@ internal class RegistryKeyExtension : AbstractInvocationInterceptor(), BeforeAll if (annotation != null) { val registryValue = Registry.get(annotation.key) val oldValue = registryValue.asString() - context.getStore(ExtensionContext.Namespace.GLOBAL).putTyped(typedKey, RegistryValueHolder(registryValue, oldValue)) + context[typedKey] = RegistryValueHolder(registryValue, oldValue) registryValue.setValue(annotation.value) } } override fun afterAll(context: ExtensionContext) { - val regValue = context.getStore(ExtensionContext.Namespace.GLOBAL).getTyped(typedKey) ?: return + val regValue = context[typedKey] ?: return regValue.value.setValue(regValue.oldValue) }