diff options
author | 2024-08-27 14:39:06 -0700 | |
---|---|---|
committer | 2024-08-27 14:47:51 -0700 | |
commit | b47d6de9801f439ad9fd132be018f49aff32d168 (patch) | |
tree | 899cf0266304f1c9ce98171d1ac9363f91d7e90d /service/src/AutoOnFeatureTest.kt | |
parent | 9ee77103742b8e7fff7fc06c38687700b97d85f7 (diff) |
Properly use test rules in kotlin
Bug: 311772251
Flag: Exempt TEST_ONLY
Test: atest ServiceBluetoothRoboTests
Change-Id: Ibb6e8645f6e8f60bc66a8e864746f93acbd1bbc6
Diffstat (limited to 'service/src/AutoOnFeatureTest.kt')
-rw-r--r-- | service/src/AutoOnFeatureTest.kt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/service/src/AutoOnFeatureTest.kt b/service/src/AutoOnFeatureTest.kt index 31bcde3504..2c3bb082ff 100644 --- a/service/src/AutoOnFeatureTest.kt +++ b/service/src/AutoOnFeatureTest.kt @@ -56,6 +56,9 @@ import org.robolectric.Shadows.shadowOf @RunWith(RobolectricTestRunner::class) @kotlinx.coroutines.ExperimentalCoroutinesApi class AutoOnFeatureTest { + @get:Rule val testName = TestName() + @get:Rule val expect = Expect.create() + private val looper = Looper.getMainLooper() private val state = BluetoothAdapterState() private val context = ApplicationProvider.getApplicationContext<Context>() @@ -65,9 +68,6 @@ class AutoOnFeatureTest { private var callback_count = 0 - @JvmField @Rule val testName = TestName() - @JvmField @Rule val expect = Expect.create() - @Before fun setUp() { Log.i("AutoOnFeatureTest", "\t--> setUp(${testName.getMethodName()})") |