File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ class PluginResolver private constructor(callerStackTrace: Array<StackTraceEleme
4545 * Sets a PluginResolver instance to a thread-local for the current thread.
4646 * This value will be retrieved by subsequent calls to fromCurrentThread.
4747 */
48- fun setThreadLocal (value : PluginResolver ) {
48+ fun setThreadLocal (value : PluginResolver ? ) {
4949 threadLocalResolver.set(value)
5050 }
5151 }
Original file line number Diff line number Diff line change @@ -6,28 +6,25 @@ package software.aws.toolkits.jetbrains.services.telemetry
66import com.intellij.ide.plugins.IdeaPluginDescriptor
77import com.intellij.ide.plugins.PluginManagerCore
88import io.mockk.called
9- import io.mockk.clearAllMocks
109import io.mockk.every
10+ import io.mockk.junit5.MockKExtension
1111import io.mockk.mockk
1212import io.mockk.mockkStatic
1313import io.mockk.verify
1414import junit.framework.TestCase.assertEquals
15- import org.junit.jupiter.api.AfterEach
1615import org.junit.jupiter.api.BeforeEach
1716import org.junit.jupiter.api.Test
17+ import org.junit.jupiter.api.extension.ExtendWith
1818import software.amazon.awssdk.services.toolkittelemetry.model.AWSProduct
1919
20+ @ExtendWith(MockKExtension ::class )
2021class PluginResolverTest {
2122 @BeforeEach
2223 fun setup () {
24+ PluginResolver .setThreadLocal(null )
2325 mockkStatic(PluginManagerCore ::class )
2426 }
2527
26- @AfterEach
27- fun tearDown () {
28- clearAllMocks()
29- }
30-
3128 @Test
3229 fun getsProductForAmazonQPlugin () {
3330 val pluginDescriptor = mockk<IdeaPluginDescriptor > {
You can’t perform that action at this time.
0 commit comments