Skip to content

Commit 96ccc71

Browse files
committed
Fix detekt issues in TelemetryHelperTest and CodeInsightsSettingsFacadeTest
1 parent d2dfb90 commit 96ccc71

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

plugins/amazonq/chat/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/amazonq/TelemetryHelperTest.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import org.assertj.core.api.Assertions.assertThat
1515
import org.junit.jupiter.api.AfterEach
1616
import org.junit.jupiter.api.BeforeEach
1717
import org.junit.jupiter.api.Test
18-
import org.junit.jupiter.api.extension.RegisterExtension
1918
import org.mockito.kotlin.any
2019
import org.mockito.kotlin.argumentCaptor
2120
import org.mockito.kotlin.doReturn
@@ -72,7 +71,7 @@ import kotlin.test.assertNotNull
7271

7372
class TelemetryHelperTest {
7473
private lateinit var myFixture: CodeInsightTestFixture
75-
74+
7675
// sut
7776
private lateinit var sut: TelemetryHelper
7877

@@ -161,14 +160,14 @@ class TelemetryHelperTest {
161160
val fixtureBuilder = factory.createLightFixtureBuilder("TelemetryHelperTest")
162161
myFixture = factory.createCodeInsightFixture(fixtureBuilder.fixture, LightTempDirTestFixtureImpl(true))
163162
myFixture.setUp()
164-
163+
165164
// NOW manually initialize mocks - Application exists now
166165
mockClientManager.beforeEach(null)
167166
mockTelemetryService.beforeEach(null)
168-
167+
169168
// Enable telemetry for tests
170169
software.aws.toolkits.jetbrains.settings.AwsSettings.getInstance().isTelemetryEnabled = true
171-
170+
172171
// set up sut
173172
appInitContext = AmazonQAppInitContext(
174173
project = myFixture.project,
@@ -219,7 +218,7 @@ class TelemetryHelperTest {
219218
// Clean up mocks first
220219
mockTelemetryService.afterEach(null)
221220
mockClientManager.afterEach(null)
222-
221+
223222
// Then tear down fixture
224223
myFixture.tearDown()
225224
}

plugins/amazonq/codewhisperer/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/codewhisperer/util/CodeInsightsSettingsFacadeTest.kt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ class CodeInsightsSettingsFacadeTest : HeavyPlatformTestCase() {
3131
}
3232

3333
fun testDisableCodeInsightUntilShouldRevertWhenParentIsDisposed() {
34-
val myFakePopup = object : Disposable {
35-
override fun dispose() {}
36-
}
34+
val myFakePopup = Disposable {}
3735
Disposer.register(testRootDisposable, myFakePopup)
3836

3937
// assume users' enable the following two codeinsight functionalities
@@ -78,14 +76,10 @@ class CodeInsightsSettingsFacadeTest : HeavyPlatformTestCase() {
7876
}
7977

8078
fun testDisableCodeInsightUntilShouldAlwaysFlushPendingRevertsBeforeMakingNextChanges() {
81-
val myFakePopup = object : Disposable {
82-
override fun dispose() {}
83-
}
79+
val myFakePopup = Disposable {}
8480
Disposer.register(testRootDisposable, myFakePopup)
8581

86-
val myAnotherFakePopup = object : Disposable {
87-
override fun dispose() {}
88-
}
82+
val myAnotherFakePopup = Disposable {}
8983
Disposer.register(testRootDisposable, myAnotherFakePopup)
9084

9185
// assume users' enable the following two codeinsight functionalities

0 commit comments

Comments
 (0)